12namespace templa::internal
27 template <
typename... Ts>
35 template <
typename T, T... elems>
44 template <
typename... Ts>
51 constexpr static size_t size =
sizeof...(Ts);
60 template <
template <
typename...>
class T,
typename... Ts>
74 template <
typename T, std::size_t N, T... elems>
78 constexpr static std::array<T, N>
array = {elems...};
81 constexpr static std::size_t
size = N;
97 using type =
decltype(a)::value_type;
103 constexpr static auto value = []<std::size_t... I>(std::index_sequence<I...>)
consteval
105 return decltype(a){a[I]...};
106 }(std::make_index_sequence<a.size()>{});
119 template <
auto... elems>
124 constexpr static std::size_t
size =
sizeof...(elems);
127 constexpr static bool valid = (std::is_same_v<std::decay_t<
decltype(elems)>, std::decay_t<decltype(std::get<0>(std::tuple{elems...}))>> && ...) &&
131 "elements must be of uniform type and comparable");
135 constexpr static auto lambda =
136 []<std::size_t... I>(std::index_sequence<I...>)
138 constexpr std::tuple<
decltype(elems)...> tup{elems...};
139 return std::get<0>(tup);
144 using uniform_type =
typename std::array<
decltype(lambda(std::make_index_sequence<size>{})),
size>;
Concept to check if a type supports common comparison operators.
Definition concepts.hpp:57
Concept that models an STL-like container.
Definition concepts.hpp:245
Internal utilities and implementation details.
Definition pack.hpp:22
Extract elements from a container-like template parameter as a new container.
Definition pack.hpp:95
decltype(a)::value_type type
Value type of the container.
Definition pack.hpp:97
static constexpr std::size_t size
Number of elements in the generated container.
Definition pack.hpp:109
static constexpr auto value
Compile-time generated container with the elements of a. Uses index_sequence to access each element.
Definition pack.hpp:103
Forward a list of elements as a std::array.
Definition pack.hpp:76
T type
The type of elements.
Definition pack.hpp:84
static constexpr std::array< T, N > array
Static array holding the elements.
Definition pack.hpp:78
static constexpr std::size_t size
Number of elements.
Definition pack.hpp:81
A template pack holding a list of values of type T.
Definition pack.hpp:36
A template pack to hold a variadic list of types.
Definition pack.hpp:28
type_list< Ts... > type
Type alias for the type_list containing the unpacked types.
Definition pack.hpp:64
A compile-time list of types.
Definition pack.hpp:46
static constexpr size_t size
Definition pack.hpp:51
hidden::pack< Ts... > type
Type alias for the internal pack of types.
Definition pack.hpp:48