|
microfmt
Zero-allocation C++ formatting for constrained environments
|
Always-safe reflection opt-in markers: MICROFMT_REFLECT_FORMAT, MICROFMT_REFLECT_DUMP_ENUM, MICROFMT_REFLECT_DUMP_STRUCT.
More...


Go to the source code of this file.
Classes | |
| struct | microfmt::enable_reflect_format< T > |
Opt-in customization point for formatter<T> struct reflection. More... | |
Namespaces | |
| namespace | microfmt |
Macros | |
| #define | MICROFMT_REFLECT_FORMAT(Type) |
| #define | MICROFMT_REFLECT_DUMP_ENUM(Type) |
| #define | MICROFMT_REFLECT_DUMP_STRUCT(Type) |
Always-safe reflection opt-in markers: MICROFMT_REFLECT_FORMAT, MICROFMT_REFLECT_DUMP_ENUM, MICROFMT_REFLECT_DUMP_STRUCT.
Unlike reflection.hpp, this header never requires -freflection and never hard-errors without it. Include it directly next to a type's own definition – the same placement convention RELOCO_TYPE_INSTANCE uses (see jplcz_reloco's docs/shared-library.md) – so the same, unmodified header compiles under every toolchain a project supports:
-std=c++26 -freflection, MICROFMT_REFLECT_FORMAT additionally opts the type in to reflection.hpp's live formatter (see that header), and, only in a dedicated code-generator binary built with -DMICROFMT_REFLECT_DUMP_MODE, every macro here also registers the type so microfmt::detail::render_reflect_dump() can emit an equivalent, hand-written-looking formatter<T>/formatter<E> specialization as plain C++ text – see tools/reflect_dump/.See docs/reflection.md for the full writeup, including exact build commands for the generator and the generated header's own reflection guard.
| #define MICROFMT_REFLECT_DUMP_ENUM | ( | Type | ) |
| #define MICROFMT_REFLECT_DUMP_STRUCT | ( | Type | ) |
| #define MICROFMT_REFLECT_FORMAT | ( | Type | ) |