Skip to content

Commit

Permalink
updated
Browse files Browse the repository at this point in the history
  • Loading branch information
dakka committed Jun 12, 2024
1 parent 7698265 commit 2ed7b56
Showing 1 changed file with 27 additions and 22 deletions.
49 changes: 27 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ component::path
path
```
### Aliases
Because all methods in `conjure_enum` are within a `class` instead of individual template functions in a `namespace`, you can reduce your
Because all methods in `conjure_enum` are defined within a `class` instead of individual template functions in a `namespace`, you can reduce your
typing with standard aliases:
```c++
using ec = conjure_enum<component>;
Expand Down Expand Up @@ -573,7 +573,7 @@ path
```c++
static constexpr bool has_scope(std::string_view what);
```
Returns `true` if the supplied string is scoped (and is valid).
Returns `true` if the supplied string representation is scoped (and is valid).
```c++
std::cout << std::format("{}\n", conjure_enum<component>::has_scope("component::scheme"));
std::cout << std::format("{}\n", conjure_enum<component>::has_scope("scheme"));
Expand Down Expand Up @@ -932,7 +932,7 @@ numbers::nine
---
# 5. API and Examples using `conjure_type`
`conjure_type` is a general purpose class allowing you to extract a string representation of any type.
The string will be stored statically by the compiler, so use the statically generated value `name` for your type.
The string will be stored statically by the compiler, so you can use the statically generated value `name` to obtain your type.
```c++
template<typename T>
class conjure_type;
Expand Down Expand Up @@ -1073,36 +1073,41 @@ You should attach the output of this application with your issue.
$ ./srcloctest
Compiler: Clang: Ubuntu Clang 16.0.6 (23ubuntu4)
1. scoped enum
static const char *conjure_enum<Type>::tpeek() [T = Type]
static const char *conjure_enum<Type>::epeek() [T = Type, e = Type::Value]
static const char *conjure_enum<Type>::epeek() [T = Type, e = (Type)100]
static const char *conjure_enum<Namespace_Enum_Type>::tpeek() [T = Namespace_Enum_Type]
static const char *conjure_enum<Namespace_Enum_Type>::epeek() [T = Namespace_Enum_Type, e = Namespace_Enum_Type::Value]
static const char *conjure_enum<Namespace_Enum_Type>::epeek() [T = Namespace_Enum_Type, e = (Namespace_Enum_Type)100]

2. unscoped enum
static const char *conjure_enum<Type1>::tpeek() [T = Type1]
static const char *conjure_enum<Type1>::epeek() [T = Type1, e = Value]
static const char *conjure_enum<Type1>::epeek() [T = Type1, e = (Type1)100]
static const char *conjure_enum<Namespace_Enum_Type1>::tpeek() [T = Namespace_Enum_Type1]
static const char *conjure_enum<Namespace_Enum_Type1>::epeek() [T = Namespace_Enum_Type1, e = Value]
static const char *conjure_enum<Namespace_Enum_Type1>::epeek() [T = Namespace_Enum_Type1, e = (Namespace_Enum_Type1)100]

3. scoped enum in anonymous namespace
static const char *conjure_enum<(anonymous namespace)::Anon_Type>::tpeek() [T = (anonymous namespace)::Anon_Type]
static const char *conjure_enum<(anonymous namespace)::Anon_Type>::epeek() [T = (anonymous namespace)::Anon_Type, e = (anonymous namespace)::Anon_Type::Value]
static const char *conjure_enum<(anonymous namespace)::Anon_Type>::epeek() [T = (anonymous namespace)::Anon_Type, e = ((anonymous namespace)::Anon_Type)100]
static const char *conjure_enum<(anonymous namespace)::Anon_Enum_Type>::tpeek() [T = (anonymous namespace)::Anon_Enum_Type]
static const char *conjure_enum<(anonymous namespace)::Anon_Enum_Type>::epeek() [T = (anonymous namespace)::Anon_Enum_Type, e = (anonymous namespace)::Anon_Enum_Type::Value]
static const char *conjure_enum<(anonymous namespace)::Anon_Enum_Type>::epeek() [T = (anonymous namespace)::Anon_Enum_Type, e = ((anonymous namespace)::Anon_Enum_Type)100]

4. unscoped enum in anonymous namespace
static const char *conjure_enum<(anonymous namespace)::Anon_Type1>::tpeek() [T = (anonymous namespace)::Anon_Type1]
static const char *conjure_enum<(anonymous namespace)::Anon_Type1>::epeek() [T = (anonymous namespace)::Anon_Type1, e = (anonymous namespace)::Value]
static const char *conjure_enum<(anonymous namespace)::Anon_Type1>::epeek() [T = (anonymous namespace)::Anon_Type1, e = ((anonymous namespace)::Anon_Type1)100]
static const char *conjure_enum<(anonymous namespace)::Anon_Enum_Type1>::tpeek() [T = (anonymous namespace)::Anon_Enum_Type1]
static const char *conjure_enum<(anonymous namespace)::Anon_Enum_Type1>::epeek() [T = (anonymous namespace)::Anon_Enum_Type1, e = (anonymous namespace)::Value]
static const char *conjure_enum<(anonymous namespace)::Anon_Enum_Type1>::epeek() [T = (anonymous namespace)::Anon_Enum_Type1, e = ((anonymous namespace)::Anon_Enum_Type1)100]

5. scoped enum in namespace
static const char *conjure_enum<Namespace::Type>::tpeek() [T = Namespace::Type]
static const char *conjure_enum<Namespace::Type>::epeek() [T = Namespace::Type, e = Namespace::Type::Value]
static const char *conjure_enum<Namespace::Type>::epeek() [T = Namespace::Type, e = (Namespace::Type)100]
static const char *conjure_enum<Namespace::Namespace_Enum_Type>::tpeek() [T = Namespace::Namespace_Enum_Type]
static const char *conjure_enum<Namespace::Namespace_Enum_Type>::epeek() [T = Namespace::Namespace_Enum_Type, e = Namespace::Namespace_Enum_Type::Value]
static const char *conjure_enum<Namespace::Namespace_Enum_Type>::epeek() [T = Namespace::Namespace_Enum_Type, e = (Namespace::Namespace_Enum_Type)100]

6. unscoped enum in namespace
static const char *conjure_enum<Namespace::Type1>::tpeek() [T = Namespace::Type1]
static const char *conjure_enum<Namespace::Type1>::epeek() [T = Namespace::Type1, e = Namespace::Value]
static const char *conjure_enum<Namespace::Type1>::epeek() [T = Namespace::Type1, e = (Namespace::Type1)100]
static const char *conjure_enum<Namespace::Namespace_Enum_Type1>::tpeek() [T = Namespace::Namespace_Enum_Type1]
static const char *conjure_enum<Namespace::Namespace_Enum_Type1>::epeek() [T = Namespace::Namespace_Enum_Type1, e = Namespace::Value]
static const char *conjure_enum<Namespace::Namespace_Enum_Type1>::epeek() [T = Namespace::Namespace_Enum_Type1, e = (Namespace::Namespace_Enum_Type1)100]

7. other type
7. types in named and anonymous namespaces
static const char *conjure_type<Foo>::tpeek() [T = Foo]
static const char *conjure_type<Namespace::Namespace_Foo>::tpeek() [T = Namespace::Namespace_Foo]
static const char *conjure_type<(anonymous namespace)::Anon_Foo>::tpeek() [T = (anonymous namespace)::Anon_Foo]

## 8. other types
static const char *conjure_type<int>::tpeek() [T = int]
static const char *conjure_type<std::basic_string_view<char>>::tpeek() [T = std::basic_string_view<char>]
static const char *conjure_type<std::vector<std::tuple<int, char, std::basic_string_view<char>>>>::tpeek() [T = std::vector<std::tuple<int, char, std::basic_string_view<char>>>]
Expand Down

0 comments on commit 2ed7b56

Please sign in to comment.