update doc
This commit is contained in:
parent
6e97229efd
commit
1b8b849184
2 changed files with 4 additions and 4 deletions
|
@ -38,12 +38,12 @@
|
||||||
#include <nameof.hpp>
|
#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
|
```cpp
|
||||||
#include <nameof.hpp>
|
#include <nameof.hpp>
|
||||||
|
|
||||||
enum number { one = 100, two = 200, three = 300 };
|
enum class number { one = 100, two = 200, three = 300 };
|
||||||
|
|
||||||
namespace nameof {
|
namespace nameof {
|
||||||
template <>
|
template <>
|
||||||
|
@ -51,7 +51,7 @@
|
||||||
static constexpr int min = 100;
|
static constexpr int min = 100;
|
||||||
static constexpr int max = 300;
|
static constexpr int max = 300;
|
||||||
};
|
};
|
||||||
}
|
} // namespace nameof
|
||||||
```
|
```
|
||||||
|
|
||||||
* If you hit a message like this:
|
* If you hit a message like this:
|
||||||
|
|
|
@ -87,7 +87,7 @@ struct enum_range<number> {
|
||||||
static constexpr int max = 300;
|
static constexpr int max = 300;
|
||||||
static_assert(max > min, "nameof::enum_range<number> requires max > min.");
|
static_assert(max > min, "nameof::enum_range<number> requires max > min.");
|
||||||
};
|
};
|
||||||
}
|
} // namespace nameof
|
||||||
|
|
||||||
SomeStruct struct_var;
|
SomeStruct struct_var;
|
||||||
Long othervar;
|
Long othervar;
|
||||||
|
|
Loading…
Reference in a new issue