![]() |
Home | Libraries | People | FAQ | More |
![]() |
Caution |
---|---|
Recommended C++ Standards are C++17 and above. Library requires at least C++14! Pre C++14 compilers (C++11, C++03...) are not supported. |
PFR library works with types that satisfy the requirements of SimpleAggregate
: aggregate types without
base classes, const
fields, references,
or C arrays:
struct simple_aggregate { // SimpleAggregate std::string name; int age; boost::uuids::uuid uuid; }; struct empty { // SimpleAggregate }; struct aggregate : empty { // not a SimpleAggregate std::string name; int age; boost::uuids::uuid uuid; };
The library may work with aggregates that don't satisfy the requirements of
SimpleAggregate
, but the behavior
tends to be non-portable.
By default PFR auto-detects your compiler abilities and automatically defines the configuration macro into appropriate values. If you wish to override that behavior, just define:
Table 1.2. Macros
Macro name |
Effect |
---|---|
PFR_USE_CPP17 |
Define to |
PFR_USE_LOOPHOLE |
Define to |
PFR_USE_STD_MAKE_INTEGRAL_SEQUENCE |
Define to |
PFR_HAS_GUARANTEED_COPY_ELISION |
Define to |
PFR_ENABLE_IMPLICIT_REFLECTION |
Define to |
PFR_ENABLED |
On platforms where PFR is not supported, the |
The PFRs reflection has some limitations that depend on a C++ Standard and compiler capabilities:
pfr::get
, pfr::structure_to_tuple
,
pfr::structure_tie
,
pfr/core.hpp
require T to be a POD type with built-in types only.