Skip to content

Commit

Permalink
updated
Browse files Browse the repository at this point in the history
  • Loading branch information
David Dight committed Aug 17, 2024
1 parent f65ec38 commit 06b44c7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ enum class numbers { zero, one, two, three, four, five, six, seven, eight, nine
## a) `enum_to_string`
```c++
static constexpr std::string_view enum_to_string(T value, bool noscope=false);
template<T e>
static constexpr std::string_view enum_to_string();
```
Returns a `std::string_view` or empty if not found. Optionally passing `true` will remove scope in result if present.
`noscope` option ![](assets/notminimalred.svg).
Expand All @@ -123,13 +125,15 @@ auto name_trim { conjure_enum<component>::enum_to_string(component::path, true)
auto alias_name { conjure_enum<component>::enum_to_string(component::test) }; // alias
auto noscope_name { conjure_enum<component1>::enum_to_string(path) };
std::cout << name << '\n' << name_trim << '\n' << alias_name << '\n' << noscope_name << '\n';
std::cout << conjure_enum<numbers>::enum_to_string<numbers::two>() << '\n';
```
_output_
```CSV
component::path
path
component::path
path
numbers::two
```
### Aliases
Because all methods in `conjure_enum` are defined _within_ a `class` instead of individual template functions in a `namespace`, you can reduce your
Expand Down

0 comments on commit 06b44c7

Please sign in to comment.