mirror of
https://github.com/Neargye/magic_enum.git
synced 2026-01-09 23:34:23 +00:00
add url to doc
This commit is contained in:
parent
05c2b7dc84
commit
b345086868
2 changed files with 6 additions and 8 deletions
|
|
@ -27,8 +27,8 @@ Header-only C++17 library provides static reflection for enums, work with any en
|
|||
* `enum_count` returns number of enum values.
|
||||
* `enum_name` obtains string name from enum value.
|
||||
* `enum_names` obtains string enum name sequence.
|
||||
* `is_unscoped_enum` checks whether type is an Unscoped enumeration.
|
||||
* `is_scoped_enum` checks whether type is an Scoped enumeration.
|
||||
* `is_unscoped_enum` checks whether type is an [Unscoped enumeration](https://en.cppreference.com/w/cpp/language/enum#Unscoped_enumeration).
|
||||
* `is_scoped_enum` checks whether type is an [Scoped enumeration](https://en.cppreference.com/w/cpp/language/enum#Scoped_enumerations).
|
||||
|
||||
## Features
|
||||
|
||||
|
|
@ -139,7 +139,7 @@ enum Color { RED = 2, BLUE = 4, GREEN = 8 };
|
|||
std::cout << color << std::endl; // "BLUE"
|
||||
```
|
||||
|
||||
* Checks whether type is an Unscoped enumeration.
|
||||
* Checks whether type is an [Unscoped enumeration](https://en.cppreference.com/w/cpp/language/enum#Unscoped_enumeration).
|
||||
```cpp
|
||||
enum color { red, green, blue };
|
||||
enum class direction { left, right };
|
||||
|
|
@ -152,7 +152,7 @@ enum Color { RED = 2, BLUE = 4, GREEN = 8 };
|
|||
magic_enum::is_unscoped_enum_v<color> -> true
|
||||
```
|
||||
|
||||
* Checks whether type is an Scoped enumeration.
|
||||
* Checks whether type is an [Scoped enumeration](https://en.cppreference.com/w/cpp/language/enum#Scoped_enumerations).
|
||||
```cpp
|
||||
enum color { red, green, blue };
|
||||
enum class direction { left, right };
|
||||
|
|
|
|||
|
|
@ -197,16 +197,14 @@ struct is_unscoped_enum_impl<T, true> : std::bool_constant<std::is_convertible_v
|
|||
|
||||
} // namespace magic_enum::detail
|
||||
|
||||
// Checks whether T is an Unscoped enumeration type. Provides the member constant value which is equal to true, if T is an Unscoped enumeration type. Otherwise, value is equal to false.
|
||||
// https://en.cppreference.com/w/cpp/language/enum#Unscoped_enumeration
|
||||
// Checks whether T is an Unscoped enumeration type. Provides the member constant value which is equal to true, if T is an [Unscoped enumeration](https://en.cppreference.com/w/cpp/language/enum#Unscoped_enumeration) type. Otherwise, value is equal to false.
|
||||
template <typename T>
|
||||
struct is_unscoped_enum : detail::is_unscoped_enum_impl<T> {};
|
||||
|
||||
template <typename T>
|
||||
inline constexpr bool is_unscoped_enum_v = is_unscoped_enum<T>::value;
|
||||
|
||||
// Checks whether T is an Scoped enumeration type. Provides the member constant value which is equal to true, if T is an Scoped enumeration type. Otherwise, value is equal to false.
|
||||
// https://en.cppreference.com/w/cpp/language/enum#Scoped_enumerations
|
||||
// Checks whether T is an Scoped enumeration type. Provides the member constant value which is equal to true, if T is an [Scoped enumeration](https://en.cppreference.com/w/cpp/language/enum#Scoped_enumerations) type. Otherwise, value is equal to false.
|
||||
template <typename T>
|
||||
struct is_scoped_enum : detail::is_scoped_enum_impl<T> {};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue