mirror of
https://github.com/Neargye/magic_enum
synced 2026-06-08 12:00:02 +00:00
update range
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
[](https://travis-ci.org/Neargye/magic_enum)
|
||||
[](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://wandbox.org/permlink/XfV2tDCzFdk36RSG)
|
||||
[](https://wandbox.org/permlink/KOo6s4qJ9wUSxRGG)
|
||||
|
||||
## 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.
|
||||
|
||||
* 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
|
||||
#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>
|
||||
```
|
||||
|
||||
|
||||
@@ -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.
|
||||
#if !defined(MAGIC_ENUM_RANGE)
|
||||
# define MAGIC_ENUM_RANGE 128
|
||||
# define MAGIC_ENUM_RANGE 256
|
||||
#endif
|
||||
|
||||
namespace magic_enum {
|
||||
|
||||
Reference in New Issue
Block a user