diff --git a/README.md b/README.md index 4539fc2..2f93684 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ Header-only C++17 library provides static reflection for enums, work with any en * `enum_type_name` returns name of enum type. * `is_unscoped_enum` checks whether type is an [Unscoped enumeration](https://en.cppreference.com/w/cpp/language/enum#Unscoped_enumeration). * `is_scoped_enum` checks whether type is an [Scoped enumeration](https://en.cppreference.com/w/cpp/language/enum#Scoped_enumerations). -* `underlying_type` improved UB-free "SFINAE-friendly" [std::underlying_type](https://en.cppreference.com/w/cpp/types/underlying_type). +* `underlying_type` improved UB-free "SFINAE-friendly" [underlying_type](https://en.cppreference.com/w/cpp/types/underlying_type). * `ostream_operators` ostream operators for enums. * `bitwise_operators` bitwise operators for enums. diff --git a/doc/limitations.md b/doc/limitations.md index cdd3747..8598bcc 100644 --- a/doc/limitations.md +++ b/doc/limitations.md @@ -1,9 +1,10 @@ # Limitations -* To check is magic_enum supported compiler use macro `MAGIC_ENUM_SUPPORTED` or constexpr constant `magic_enum::is_magic_enum_supported`. - * This library uses a compiler-specific hack (based on `__PRETTY_FUNCTION__` / `__FUNCSIG__`), which works on Clang >= 5, MSVC >= 15.3 and GCC >= 9. +* To check is magic_enum supported compiler use macro `MAGIC_ENUM_SUPPORTED` or constexpr constant `magic_enum::is_magic_enum_supported`.
+ If magic_enum used on unsupported compiler, occurs the compilation error. To suppress error define macro `MAGIC_ENUM_NO_CHECK_SUPPORT`. + * Enum can't reflect if the enum is a forward declaration. * Enum value must be in range `[MAGIC_ENUM_RANGE_MIN, MAGIC_ENUM_RANGE_MAX]`. diff --git a/doc/reference.md b/doc/reference.md index 7d1d670..f1a056f 100644 --- a/doc/reference.md +++ b/doc/reference.md @@ -26,6 +26,19 @@ * For the small enum use the API from the namespace `magic_enum`, and for enum-flags use the API from the namespace `magic_enum::flags`. +* To add custom enum or type names see the [example](../example/example_custom_name.cpp). + +* To change the type of strings or ortional, use special macros: + + ```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; + #include + ``` + ## `enum_cast` ```cpp