mirror of
https://codeberg.org/DawnMagnet/reflect-cpp
synced 2026-11-29 06:16:19 +08:00
Adapted the documentation to the possibility of leaving out rfl::Field
This commit is contained in:
@@ -19,11 +19,11 @@ So this is how we could rewrite the previous example:
|
||||
|
||||
```cpp
|
||||
struct Person {
|
||||
rfl::Field<"firstName", std::string> first_name;
|
||||
rfl::Field<"lastName", std::string> last_name = "Simpson";
|
||||
rfl::Rename<"firstName", std::string> first_name;
|
||||
rfl::Rename<"lastName", std::string> last_name = "Simpson";
|
||||
|
||||
// Indicates to the library that the field is optional.
|
||||
rfl::Field<"children", std::optional<std::vector<Person>>> children = rfl::default_value;
|
||||
std::optional<std::vector<Person>> children;
|
||||
};
|
||||
|
||||
const auto bart = Person{.first_name = "Bart"};
|
||||
|
||||
Reference in New Issue
Block a user