Files
reflect-cpp/docs/README.md
T
2023-10-03 17:57:08 +02:00

1.4 KiB

Documentation

image

1) The basics

1.1) Structs - Recaps the motivating example in the README. A struct is the equivalent of an AND statement or a product type in type theory.

1.2) Optional fields - For when you have fields in your serialized format that might be absent in some cases.

1.3) Struct flattening - For when you want struct A to "inherit" the fields of struct B.

1.4) String literals - For when you have strings that can only assume a limited number of enumerated values.

1.5) std::variant and rfl::TaggedUnion - For when your structs can be one of several formats. This is the equivalent of an OR statement or a sum type in type theory.

2) Custom classes

2.1) Custom classes - For when you have custom classes with private fields.

2.2) Custom parsers for your classes - For when you have custom classes with private fields and you want to leave them absolutely untouched.