Record provides a linear, direct accessible data structure with heterogeneous entries.
A record type will be defined with the macro BRAINTWISTER_RECORD.
For example a database connection type can be defined by
The entry default values are mandatory.
Construction by JSON or XML
It is also possible to construct an object by JSON or XML. The construction is
order independent and use the default values if it is not given in JSON/XML.
Here, the string literal R is only used to avoid the escape of the
quotation marks for a better readability. The XML initialization is similar.
Usage example: Functor state
When using functors it is advantageous to separate the state into a passive data structure (PDS).