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

how to use std::string? #85

Closed dotkt closed 3 years ago

dotkt commented 3 years ago

图片

i add std::string member c at the sample code but get this error: cista.h(4608,19): error C2338: Please implement custom serializer

is there example using std library with cista?

felixguendling commented 3 years ago

I would not recommend using std:: data structures. If you are using only std:: data structures you can probably also use cereal. With cista, I would recommend using cista::raw::string, etc.

If you want to write a custom serializer for std:: data structures, you might want to look into this: https://github.com/felixguendling/cista/blob/master/test/std_vector_test.cc

Edit: all the performance and benefits from cista come from using cista:: data structures.

dotkt commented 3 years ago

thank you very much.