diff --git a/doc/reference.md b/doc/reference.md index 100ba2e..6e2049b 100644 --- a/doc/reference.md +++ b/doc/reference.md @@ -38,6 +38,22 @@ #define MAGIC_ENUM_USING_ALIAS_OPTIONAL template using optional = my_lib::Optional; #include ``` + Optionally define `MAGIC_ENUM_CONFIG_FILE` i.e., in your build system, with path to header file with defined + macros or constants, for example: + + ```cpp + #define MAGIC_ENUM_CONFIG_FILE "my_magic_enum_cfg.hpp" + ``` + my_magic_enum_cfg.hpp: + ```cpp + #include + #include + #define MAGIC_ENUM_USING_ALIAS_STRING using string = my_lib::String; + #define MAGIC_ENUM_USING_ALIAS_STRING_VIEW using string_view = my_lib::StringView; + #define MAGIC_ENUM_USING_ALIAS_OPTIONAL template using optional = my_lib::Optional; + #define MAGIC_ENUM_RANGE_MIN 0 + #define MAGIC_ENUM_RANGE_MAX 255 + ``` ## `enum_cast` diff --git a/include/magic_enum.hpp b/include/magic_enum.hpp index 18c2804..0a03c4b 100644 --- a/include/magic_enum.hpp +++ b/include/magic_enum.hpp @@ -45,6 +45,10 @@ #include #include +#if defined(MAGIC_ENUM_CONFIG_FILE) +#include MAGIC_ENUM_CONFIG_FILE +#endif + #if !defined(MAGIC_ENUM_USING_ALIAS_OPTIONAL) #include #endif