update doc

This commit is contained in:
neargye 2020-02-14 18:04:48 +05:00
parent 6e97229efd
commit 1b8b849184
2 changed files with 4 additions and 4 deletions

View file

@ -38,12 +38,12 @@
#include <nameof.hpp>
```
* If need another range for specific enum type, add specialization `enum_range` for necessary enum type.
* 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 nameof`.
```cpp
#include <nameof.hpp>
enum number { one = 100, two = 200, three = 300 };
enum class number { one = 100, two = 200, three = 300 };
namespace nameof {
template <>
@ -51,7 +51,7 @@
static constexpr int min = 100;
static constexpr int max = 300;
};
}
} // namespace nameof
```
* If you hit a message like this:

View file

@ -87,7 +87,7 @@ struct enum_range<number> {
static constexpr int max = 300;
static_assert(max > min, "nameof::enum_range<number> requires max > min.");
};
}
} // namespace nameof
SomeStruct struct_var;
Long othervar;