14#ifndef __AUDACITY_TYPE_ENUMERATOR__
15#define __AUDACITY_TYPE_ENUMERATOR__
32 typename decltype(enumerateTypes(
33 Tag{},
Location{}, std::integral_constant<unsigned, U>{}))::type;
42template<
typename Tag,
typename Location>
class CountTypes {
43 template<
unsigned U>
struct Stop{
static constexpr unsigned value = U; };
44 template<
unsigned U>
struct Count : std::conditional_t<
45 std::is_same_v<Unenumerated, EnumeratedType<Tag, Location, U>>,
54template<
typename Tag,
typename T>
74#define BEGIN_TYPE_ENUMERATION(Tag) namespace { \
76 auto enumerateTypes(Tag, Tag, ...) -> TypeEnumerator::detail::Unenumerated; }
79#define ENUMERATE_TYPE(Tag, T) namespace { auto enumerateTypes( \
80 Tag, Tag, std::integral_constant<unsigned, \
81 TypeEnumerator::detail::TypeCounter<Tag, T>::value>) \
82 -> TypeEnumerator::detail::type_identity<T>; }
91 static_assert(std::is_base_of_v<Tag, Location>);
97 : std::conditional_t<std::is_same_v<detail::Unenumerated, Type>,
99 Accumulate<U + 1, Types..., Type>
103 :
AccumulateType<U, detail::EnumeratedType<Tag, Location, U>, Types...>
Metaprogramming utilities for manipulating lists of types.
typename Accumulate< 0 >::type type
static constexpr unsigned value
Used only by WaveTrack, a special way to hold location that can accommodate merged regions.
std::vector< Type > Types
typename decltype(enumerateTypes(Tag{}, Location{}, std::integral_constant< unsigned, U >{}))::type EnumeratedType
static constexpr unsigned value
Implements the ENUMERATE_TYPE macro.
static constexpr unsigned value
A type excluded from any enumeration.
Primary template for a list of arbitrary types.