mirror of
https://github.com/Neargye/magic_enum.git
synced 2026-01-10 23:44:29 +00:00
update range
This commit is contained in:
parent
fae022c848
commit
bbda253f8b
2 changed files with 4 additions and 4 deletions
|
|
@ -16,7 +16,7 @@
|
||||||
[](https://travis-ci.org/Neargye/magic_enum)
|
[](https://travis-ci.org/Neargye/magic_enum)
|
||||||
[](https://ci.appveyor.com/project/Neargye/magic-enum-hf8vk/branch/master)
|
[](https://ci.appveyor.com/project/Neargye/magic-enum-hf8vk/branch/master)
|
||||||
[](https://www.codacy.com/app/Neargye/magic_enum?utm_source=github.com&utm_medium=referral&utm_content=Neargye/magic_enum&utm_campaign=Badge_Grade)
|
[](https://www.codacy.com/app/Neargye/magic_enum?utm_source=github.com&utm_medium=referral&utm_content=Neargye/magic_enum&utm_campaign=Badge_Grade)
|
||||||
[](https://wandbox.org/permlink/XfV2tDCzFdk36RSG)
|
[](https://wandbox.org/permlink/KOo6s4qJ9wUSxRGG)
|
||||||
|
|
||||||
## What is Magic Enum?
|
## What is Magic Enum?
|
||||||
|
|
||||||
|
|
@ -145,9 +145,9 @@ enum Color { RED = 2, BLUE = 4, GREEN = 8 };
|
||||||
|
|
||||||
* `magic_enum::enum_names` returns `std::array<std::string_view, N>` with all string enum name where `N = number of enum values`, sorted by enum value.
|
* `magic_enum::enum_names` returns `std::array<std::string_view, N>` with all string enum name where `N = number of enum values`, sorted by enum value.
|
||||||
|
|
||||||
* Enum value must be in range `(-MAGIC_ENUM_RANGE, MAGIC_ENUM_RANGE)`. By default `MAGIC_ENUM_RANGE = 128`. If you need larger range, redefine the macro `MAGIC_ENUM_RANGE`.
|
* Enum value must be in range `(-MAGIC_ENUM_RANGE, MAGIC_ENUM_RANGE)`. By default `MAGIC_ENUM_RANGE = 256`. If you need a larger range, redefine the macro `MAGIC_ENUM_RANGE`.
|
||||||
```cpp
|
```cpp
|
||||||
#define MAGIC_ENUM_RANGE 1028 // Redefine MAGIC_ENUM_RANGE for larger range.
|
#define MAGIC_ENUM_RANGE 1024 // Redefine MAGIC_ENUM_RANGE for larger range.
|
||||||
#include <magic_enum.hpp>
|
#include <magic_enum.hpp>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@
|
||||||
|
|
||||||
// Enum value must be in range (-MAGIC_ENUM_RANGE, MAGIC_ENUM_RANGE). If you need a larger range, redefine the macro MAGIC_ENUM_RANGE.
|
// Enum value must be in range (-MAGIC_ENUM_RANGE, MAGIC_ENUM_RANGE). If you need a larger range, redefine the macro MAGIC_ENUM_RANGE.
|
||||||
#if !defined(MAGIC_ENUM_RANGE)
|
#if !defined(MAGIC_ENUM_RANGE)
|
||||||
# define MAGIC_ENUM_RANGE 128
|
# define MAGIC_ENUM_RANGE 256
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace magic_enum {
|
namespace magic_enum {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue