Audacity 3.2.0
Classes | Namespaces | Macros | Typedefs
TypeEnumerator.h File Reference

Make a list of all distinct types so far mentioned in calls of a certain macro. More...

#include "TypeList.h"
Include dependency graph for TypeEnumerator.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  TypeEnumerator::detail::type_identity< T >
 Standard in C++20. More...
 
struct  TypeEnumerator::detail::Unenumerated
 A type excluded from any enumeration. More...
 
class  TypeEnumerator::detail::CountTypes< Tag, Location >
 
struct  TypeEnumerator::detail::CountTypes< Tag, Location >::Stop< U >
 
struct  TypeEnumerator::detail::CountTypes< Tag, Location >::Count< U >
 
struct  TypeEnumerator::detail::TypeCounter< Tag, T >
 Implements the ENUMERATE_TYPE macro. More...
 
struct  TypeEnumerator::detail::TypeCounter< Tag, T >::Location
 
class  TypeEnumerator::CollectTypes< Tag, Location >
 
struct  TypeEnumerator::CollectTypes< Tag, Location >::Stop< Types >
 
struct  TypeEnumerator::CollectTypes< Tag, Location >::AccumulateType< U, Type, Types >
 
struct  TypeEnumerator::CollectTypes< Tag, Location >::Accumulate< U, Types >
 

Namespaces

namespace  TypeEnumerator
 
namespace  TypeEnumerator::detail
 

Macros

#define BEGIN_TYPE_ENUMERATION(Tag)
 
#define ENUMERATE_TYPE(Tag, T)
 This macro must occur at file scope, not within any other namespace. More...
 

Typedefs

template<typename Tag , typename Location , unsigned U>
using TypeEnumerator::detail::EnumeratedType = typename decltype(enumerateTypes(Tag{}, Location{}, std::integral_constant< unsigned, U >{}))::type
 

Detailed Description

Make a list of all distinct types so far mentioned in calls of a certain macro.


Audacity: A Digital Audio Editor

Paul Licameli

Definition in file TypeEnumerator.h.

Macro Definition Documentation

◆ BEGIN_TYPE_ENUMERATION

#define BEGIN_TYPE_ENUMERATION (   Tag)
Value:
namespace { \
struct Tag{}; \
auto enumerateTypes(Tag, Tag, ...) -> TypeEnumerator::detail::Unenumerated; }
A type excluded from any enumeration.

Inject an unevaluated function, whose overloads will help to define a metafunction from an initial segment of the unsigned integers to distinct types. Tag will name an empty structure type to distinguish this enumeration. The macro call must occur at file scope, not within any other namespace.

Definition at line 74 of file TypeEnumerator.h.

◆ ENUMERATE_TYPE

#define ENUMERATE_TYPE (   Tag,
 
)
Value:
namespace { auto enumerateTypes( \
Tag, Tag, std::integral_constant<unsigned, \
Implements the ENUMERATE_TYPE macro.

This macro must occur at file scope, not within any other namespace.

Definition at line 79 of file TypeEnumerator.h.