This defect was discovered in issue #153, and resulted in reading
past memory. This fix repairs the off-by-one situations. Additionally,
in usages of this function where the size is known, it saves processing
by using the std::string's length property.
Signed-off-by: Erich Keane <erich.keane@verizon.net>
tuple names are now generated at compile time. Additionally,
a breaking-change of re-ordering tuples to be from first-last
rather than last-first has been included.
User rggjan requested that tuples provide a different name for each
element in this issue: https://github.com/USCiLab/cereal/issues/140.
This fix modifies tuple.hpp to generate tuple names in the order which
they are are placed in the tuple. Note that this will appear to be a
countdown (tuple_element2, tuple_element1, tuple_element0) since tuples
are generated in reverse order.
Signed-off-by: Erich Keane <erich.keane@verizon.net>
User rggjan requested that tuples provide a different name for each
element in this issue: https://github.com/USCiLab/cereal/issues/140.
This fix modifies tuple.hpp to generate tuple names in the order which
they are are placed in the tuple. Note that this will appear to be a
countdown (tuple_element2, tuple_element1, tuple_element0) since tuples
are generated in reverse order.
Signed-off-by: Erich Keane <erich.keane@verizon.net>
This is option 1 for #137 which I'm quite happy with. Works across compilation units and
shared libs on linux, need to test on windows.
As for #113, it doesn't seem to be an issue on linux so just remains to sort that out on windows.
Removed WrapperBase and added ElideMinimal instead, which is a trait that is checked by
text archives performing minimal serialization to see if they should go ahead and skip creating various nodes
and naming things. Currently only used on base_class and virtual_base_class
This is a solution for #46 that uses RTTI to allow get_user_data to work
and throw an error when used in an archive that doesn't actually have user
data. Unfortunately this is a run-time check and uses a dummy virtual function
that is never actually called (so the overhead of this will be very low, a few bytes
for the vtable, no runtime cost).
Another solution I'm going to play around with involves re-arranging some templates and
typedefs.
Archives that output text (human readable to some extent) should now derive from the type traits class
cereal::traits::TextArchive.
Testing for this can be done with cereal::traits::is_text_archive
Relates to #80
In sandbox_vs.cpp, there is a very strange issue with calling
traits::is_input_serializable that causes icc 15.0.0 to crash.
Everything else works great though.
Decided to go with the simple ifndef solution since the template
acrobatics to disable things just for MSVC would not ahve been worth it
Tried to add ARM build for MSVC but this turns out to be hard to do without
making a windows store/phone app, which requirse an active dev license