Comments (2)
Hi @domcir ,
Thanks for your questions.
I would refer you to the documentation, where a lot of these questions are covered:
https://github.com/getml/reflect-cpp/tree/main/docs
But to answer your questions directly:
-
Yes,
std::unique_ptr
andstd::shared_ptr
are supported. They are treated as optional fields, though (https://github.com/getml/reflect-cpp/blob/main/docs/optional_fields.md). -
No, you cannot serialize private and protected fields. This is because
rfl::xxx::write
does not have access to these fields. This is something that other programming languages, like Rust or Go, would not allow you to do either. However, you can set up your classes with private fields to be supported by reflect-cpp, like this (https://github.com/getml/reflect-cpp/blob/main/docs/custom_classes.md) or this (https://github.com/getml/reflect-cpp/blob/main/docs/custom_parser.md). -
No, you should not have a constructor at all. The struct should be an aggregate (https://github.com/getml/reflect-cpp/blob/main/docs/structs.md).
from reflect-cpp.
Thanks for the answers!
from reflect-cpp.
Related Issues (20)
- conda-forge package HOT 2
- Q: deserializing/serializing complex XML documents? HOT 6
- Reflector - separate into read and write? HOT 4
- Bug: build system assumes compiler has or is GNU-like front-end HOT 3
- Bug: number of fields in a struct is limited to 100; consider removing limitation? HOT 6
- Reflector + rfl::Flatten in ReflType HOT 2
- support for custom types HOT 2
- Compile error with structures containing bitfields HOT 1
- Can I write to buffer? HOT 1
- TaggedUnions compilation error HOT 4
- Default value of std::optional HOT 2
- Number systems support HOT 3
- SEH exception HOT 6
- std::filesystem::path support HOT 2
- inconsistent treatment of unexpected data formats / feature request DefaultIfMissing HOT 1
- Serialize tall class fails at compilation HOT 4
- RFE: Support for inclusion on Compiler Explorer HOT 4
- undefined reference to `rfl::Generic::~Generic()' HOT 4
- Stripping field name from union HOT 1
- error: implicit instantiation of undefined template 'std::tuple_size<rfl::Tuple<rfl::Field<...>>>' after #160 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from reflect-cpp.