microfmt
Zero-allocation C++ formatting for constrained environments
Loading...
Searching...
No Matches
Classes | Namespaces | Macros
reflect_annotate.hpp File Reference

Always-safe reflection opt-in markers: MICROFMT_REFLECT_FORMAT, MICROFMT_REFLECT_DUMP_ENUM, MICROFMT_REFLECT_DUMP_STRUCT. More...

#include "../detail/compat.hpp"
#include <type_traits>
Include dependency graph for reflect_annotate.hpp:
This graph shows which files directly or indirectly include this file:

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)
 

Detailed Description

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:

See docs/reflection.md for the full writeup, including exact build commands for the generator and the generated header's own reflection guard.

Macro Definition Documentation

◆ MICROFMT_REFLECT_DUMP_ENUM

#define MICROFMT_REFLECT_DUMP_ENUM (   Type)

◆ MICROFMT_REFLECT_DUMP_STRUCT

#define MICROFMT_REFLECT_DUMP_STRUCT (   Type)

◆ MICROFMT_REFLECT_FORMAT

#define MICROFMT_REFLECT_FORMAT (   Type)