6 ms·
Can it be used to implement automatic serialization on simple struct / class types?
by chakkepolja 4y ago
Can it be used to implement automatic serialization on simple struct / class types?
- aaaaaaaaaaab 4y agoIf you only use std::tuple, then yes xD
- gpderetta 4y agoThere is a nasty trick which uses structured binding to convert an arbitrary aggregate to a tuple. That still doesn't help if you want the fields names.
- chakkepolja 4y agoYou have any link?
- gpderetta 4y agoSomething like this: https://github.com/apolukhin/magic_get https://github.com/apolukhin/magic_get
- chakkepolja 4y agoThanks. This may be useful for me someday.
- otabdeveloper4 4y agoNo, because C++ templates are basically a Lisp, and only things that are list-like can be processed by templates. (Like tuples, for example.)