1
0
Fork 0
mirror of https://github.com/Neargye/magic_enum.git synced 2026-01-09 23:34:23 +00:00

improve customize

This commit is contained in:
Daniil Goncharov 2020-09-07 12:55:59 +03:00 committed by GitHub
parent 000551a655
commit 690486e7f2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 107 additions and 49 deletions

View file

@ -22,14 +22,14 @@
#include <magic_enum.hpp>
```
* If need another range for specific enum type, add specialization `enum_range` for necessary enum type. Specialization of `enum_range` must be injected in `namespace magic_enum`.
* If need another range for specific enum type, add specialization `enum_range` for necessary enum type. Specialization of `enum_range` must be injected in `namespace magic_enum::customize`.
```cpp
#include <magic_enum.hpp>
enum class number { one = 100, two = 200, three = 300 };
namespace magic_enum {
namespace magic_enum::customize {
template <>
struct enum_range<number> {
static constexpr int min = 100; // Must be greater than `INT16_MIN`.