felixguendling / cista

Cista is a simple, high-performance, zero-copy C++ serialization & reflection library.
https://cista.rocks
MIT License
1.78k stars 113 forks source link

Fails to serialize when entire vector contents are erased #108

Closed julianharbarth closed 2 years ago

julianharbarth commented 2 years ago

See the two added tests. The first one passes as expected. The second one fails.

Might be related, but I don't think neither of the two erase functions in basic_vector ensure that https://github.com/felixguendling/cista/blob/eb1b0199eef401493db0d2dd735a14481b823083/include/cista/serialization.h#L657 or similar are satisfied.

felixguendling commented 2 years ago

Thanks! I think #109 should fix the problem.

For in-memory vectors the condition does not apply. However, the require you mentioned is only checked for serialized vectors where the condition is always true.