From 866b957213623d5d7428d764239cc0aea3cf83a6 Mon Sep 17 00:00:00 2001 From: neargye Date: Tue, 9 Apr 2019 14:36:21 +0500 Subject: [PATCH] update readme --- README.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d091436..9ba5710 100644 --- a/README.md +++ b/README.md @@ -177,7 +177,16 @@ enum Color { RED = 2, BLUE = 4, GREEN = 8 }; * `magic_enum::enum_names` returns `std::array` with all string enum name where `N = number of enum values`, sorted by enum value. -* Enum value must be in range `[-256, 256]`. If you need another range, add specialization enum_range for necessary enum type. +* Enum value must be in range `[MAGIC_ENUM_RANGE_MIN, MAGIC_ENUM_RANGE_MAX]`. By default `MAGIC_ENUM_RANGE_MAX = 128`, `MAGIC_ENUM_RANGE_MIN = -128`. + + If need another range for all enum types by default, redefine the macro `MAGIC_ENUM_RANGE_MAX` and `MAGIC_ENUM_RANGE_MIN`. + ```cpp + #define MAGIC_ENUM_RANGE_MAX 256 + #define MAGIC_ENUM_RANGE_MIN 0 + #include + ``` + + If need another range for specific enum type, add specialization `enum_range` for necessary enum type. ```cpp #include