mirror of
https://github.com/Neargye/magic_enum.git
synced 2026-01-10 23:44:29 +00:00
update doc
This commit is contained in:
parent
beb77df3f1
commit
79fd207cca
3 changed files with 17 additions and 3 deletions
|
|
@ -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 <my_lib/string.hpp>
|
||||
#include <my_lib/string_view.hpp>
|
||||
#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 <typename T> using optional = my_lib::Optional<T>;
|
||||
#include <magic_enum.hpp>
|
||||
```
|
||||
|
||||
## `enum_cast`
|
||||
|
||||
```cpp
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue