mirror of
https://github.com/fraillt/bitsery.git
synced 2026-06-08 08:13:56 +00:00
hello world tutorial complete
This commit is contained in:
@@ -27,15 +27,11 @@ struct MyStruct {
|
||||
uint32_t i;
|
||||
MyEnum e;
|
||||
std::vector<float> fs;
|
||||
char16_t x;
|
||||
bool y;
|
||||
};
|
||||
|
||||
//define how object should be serialized/deserialized
|
||||
SERIALIZE(MyStruct) {
|
||||
return s.
|
||||
value1(o.y).
|
||||
value2(o.x).
|
||||
value4(o.i).
|
||||
value2(o.e).
|
||||
container4(o.fs, 10);
|
||||
@@ -71,4 +67,4 @@ int main() {
|
||||
//deserialize same object, can also be invoked like this: serialize(des, data)
|
||||
des.object(res);
|
||||
assert(data.fs == res.fs && data.i == res.i && data.e == res.e);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user