23#ifndef VCL_BASE_VARIADIC_TEMPLATES_H
24#define VCL_BASE_VARIADIC_TEMPLATES_H
45template<
typename... Args>
48 using type = std::tuple_element<0, std::tuple<Args...>>::type;
62template<
typename... Args>
72template<
typename T,
typename U,
typename...
Us>
75 if constexpr (std::is_same_v<T, U>) {
79 if constexpr (
sizeof...(Us)) {
103template<
typename U,
typename... Us>
106 if (
ti ==
typeid(U)) {
110 if constexpr (
sizeof...(Us)) {
136template<
typename T,
typename... Us>
154template<uint I,
typename... T>
157 using type = std::tuple_element_t<I, std::tuple<T...>>;
172template<uint I,
typename... T>
187template<
typename... Args>
190 static constexpr uint value =
sizeof...(Args);
210template<
typename... T>
214 static void apply(F&& f)
231template<
typename T,
template<
typename...>
class Template>
236template<
template<
typename...>
class Template,
typename... Args>
246template<
typename T,
template<
typename...>
class Template>
265template<
typename T,
template<
typename...>
class Template>
270 template<
typename... Args>
272 static std::false_type test(...);
275 static constexpr bool value =
276 decltype(test(std::declval<std::remove_cvref_t<T>*>()))::value;
284template<
typename T,
template<
typename...>
class Template>
A class representing a box in N-dimensional space.
Definition box.h:46
typename FirstType< Args... >::type FirstTypeT
Alias for the type of the first type in a pack of types.
Definition variadic_templates.h:63
constexpr bool IsDerivedFromSpecializationOfV
Alias for IsDerivedFromSpecializationOf trait.
Definition variadic_templates.h:285
typename TypeAt< I, T... >::type TypeAtT
Alias for the type at a given index in a pack of types (variadic templates) or a TypeWrapper.
Definition variadic_templates.h:173
constexpr bool IsSpecializationOfV
Alias for IsSpecializationOf trait.
Definition variadic_templates.h:247
constexpr uint UINT_NULL
The UINT_NULL value represent a null value of uint that is the maximum value that can be represented ...
Definition base.h:48
constexpr uint indexInTypePack()
Function that returns the index of a Type T in a pack of types (variadic templates)....
Definition variadic_templates.h:73
Get the first type of a pack of types (variadic templates) or a TypeWrapper.
Definition variadic_templates.h:47
Allows to apply a function to each type in a variadic template pack.
Definition variadic_templates.h:212
Get the index of a type T in a pack of types (variadic templates) or a TypeWrapper.
Definition variadic_templates.h:138
Trait to check if a type is derived from a specialization of a given template.
Definition variadic_templates.h:267
Trait to check if a type is a specialization of a given template.
Definition variadic_templates.h:233
Get the number of types in a pack of types (variadic templates) or a TypeWrapper.
Definition variadic_templates.h:189
Get the type at a given index in a pack of types (variadic templates) or a TypeWrapper.
Definition variadic_templates.h:156