mirror of
https://github.com/Neargye/magic_enum.git
synced 2026-01-09 23:34:23 +00:00
move all enum_flags_* func to enum_flags.hpp
This commit is contained in:
parent
9508c563da
commit
3b4967b21e
7 changed files with 139 additions and 125 deletions
|
|
@ -422,6 +422,8 @@ template <typename E, typename BinaryPredicate>
|
|||
constexpr bool enum_flags_contains(string_view value, BinaryPredicate p) noexcept(is_nothrow_invocable_v<BinaryPredicate>);
|
||||
```
|
||||
|
||||
* You should add the required file `<magic_enum_flags.hpp>`.
|
||||
|
||||
* Examples
|
||||
|
||||
```cpp
|
||||
|
|
@ -437,8 +439,15 @@ constexpr bool enum_flags_contains(string_view value, BinaryPredicate p) noexcep
|
|||
};
|
||||
|
||||
magic_enum::enum_flags_name(Directions::Up | Directions::Right); // directions_name -> "Directions::Up|Directions::Right"
|
||||
|
||||
magic_enum::enum_flags_contains(Directions::Up | Directions::Right); // -> true
|
||||
|
||||
magic_enum::enum_flags_cast(3); // -> "Directions::Left|Directions::Down"
|
||||
|
||||
magic_enum::enum_flags_test(Left|Down, Down); // -> "true"
|
||||
magic_enum::enum_flags_test(Left|Down, Right); // -> "false"
|
||||
|
||||
magic_enum::enum_flags_test_any(Left|Down|Right, Down|Right); // -> "true"
|
||||
```
|
||||
|
||||
## `is_unscoped_enum`
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue