mirror of
https://github.com/Neargye/magic_enum.git
synced 2026-01-10 23:44:29 +00:00
fix namespace
This commit is contained in:
parent
aaf57737d5
commit
083298a045
5 changed files with 9 additions and 9 deletions
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
* If an enum is declared as a flag enum, its zero value will not be reflected.
|
||||
|
||||
* Or, for enum types that are deeply nested in classes and/or namespaces, declare a function called `adl_magic_enum_define_range(my_enum_type)` in the same namespace as `my_enum_type`, which magic_enum will find by ADL (because the function is in the same class/namespace as `my_enum_type`), and whose return type is a `magic_enum::customize::adl_info`.
|
||||
* Or, for enum types that are deeply nested in classes and/or namespaces, declare a function called `magic_enum_define_range_adl(my_enum_type)` in the same namespace as `my_enum_type`, which magic_enum will find by ADL (because the function is in the same class/namespace as `my_enum_type`), and whose return type is a `magic_enum::customize::adl_info`.
|
||||
|
||||
```cpp
|
||||
namespace Deeply::Nested::Namespace {
|
||||
|
|
@ -32,7 +32,7 @@
|
|||
// - magic_enum will find this function by ADL
|
||||
// - uses builder pattern
|
||||
// - use auto to not have to name the type yourself
|
||||
auto adl_magic_enum_define_range(my_enum_type)
|
||||
auto magic_enum_define_range_adl(my_enum_type)
|
||||
{
|
||||
return magic_enum::customize::adl_info()
|
||||
.minmax<10,10>() // the min max search range
|
||||
|
|
|
|||
|
|
@ -570,7 +570,7 @@ constexpr bool enum_flags_contains(string_view value, BinaryPredicate p) noexcep
|
|||
magic_enum::enum_flags_test_any(Left|Down|Right, Down|Right); // -> "true"
|
||||
```
|
||||
|
||||
* Or, for enum types that are deeply nested in classes and/or namespaces, declare a function called `adl_magic_enum_define_range(my_enum_type)` in the same namespace as `my_enum_type`, which magic_enum will find by ADL (because the function is in the same class/namespace as `my_enum_type`), and whose return type is a `magic_enum::customize::adl_info`.
|
||||
* Or, for enum types that are deeply nested in classes and/or namespaces, declare a function called `magic_enum_define_range_adl(my_enum_type)` in the same namespace as `my_enum_type`, which magic_enum will find by ADL (because the function is in the same class/namespace as `my_enum_type`), and whose return type is a `magic_enum::customize::adl_info`.
|
||||
|
||||
```cpp
|
||||
namespace Deeply::Nested::Namespace {
|
||||
|
|
@ -579,7 +579,7 @@ namespace Deeply::Nested::Namespace {
|
|||
// - magic_enum will find this function by ADL
|
||||
// - uses builder pattern
|
||||
// - use auto to not have to name the type yourself
|
||||
auto adl_magic_enum_define_range(my_enum_type)
|
||||
auto magic_enum_define_range_adl(my_enum_type)
|
||||
{
|
||||
return magic_enum::customize::adl_info()
|
||||
.minmax<10,10>() // the min max search range
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue