10 #include <type_traits>
15 template <
int n,
typename... TArgs>
18 template <
int n,
typename T0,
typename... TArgs>
21 template <
typename T0,
typename... TArgs>
26 template <
int n,
typename... TArgs>
30 template <
typename T0,
int n,
typename T1,
typename... TArgs>
35 template <
typename T0,
int n,
typename T1>
37 static constexpr
int value = std::is_same<T0, T1>::value ? n : -1;
40 template <
typename T0,
typename... TArgs>
44 template <
typename... Ts>
48 template <
typename... Ts>
53 template <
typename TSignature>
58 template <
typename TFunction>
63 template <
typename TClass,
typename TReturn,
typename... TArgs>
69 template <
typename TClass,
typename TReturn,
typename... TArgs>
75 template <
typename TReturn,
typename... TArgs>
81 template <
typename TFunction>
85 template <
typename TCallable,
typename TEnabler,
typename... TArgs>
87 static constexpr
bool value =
false;
90 template <
typename TCallable,
typename... TArgs>
92 VoidType<decltype(
std::declval<TCallable>()(std::declval<TArgs>()...))>,
94 static constexpr
bool value =
true;
96 template <
typename TCallable,
typename... TArgs>
102 template <
typename T,
typename TStream,
typename =
void>
104 static constexpr
bool value =
false;
107 template <
typename T,
typename TStream>
114 template <
typename T>
123 : data(other.data) {}
126 : data(
std::addressof(ref)) {}
137 INLINE operator const T&()
const noexcept {
144 template <
typename T>
148 template <
typename T>
152 template <
typename T>
157 template <
typename T>
161 template <
typename T>
167 template <
typename T,
typename TOther>
172 template <
typename T,
typename TOther>
176 template <
typename T,
typename TOther>
180 template <
typename T,
typename TOther>
184 template <
typename T,
typename TOther>
188 template <
typename T,
typename TEnabler =
void>
192 template <
typename T>
196 template <
typename T>
200 template <
typename T>
202 static constexpr
bool value = std::is_enum<T>::value && !std::is_convertible<T, int>::value;
208 template <
bool... Values>
210 template <
bool First,
bool Second,
bool... Others>
212 static constexpr
bool value = First &&
AllTrue<Second, Others...>::value;
214 template <
bool Value>
216 static constexpr
bool value = Value;
220 template <
bool... Values>
222 template <
bool First,
bool Second,
bool... Others>
224 static constexpr
bool value = First ||
AnyTrue<Second, Others...>::value;
226 template <
bool Value>
228 static constexpr
bool value = Value;
236 template <
typename T>
241 template <
typename T>
Global parameters of the code.
#define INLINE
Macros for conditional compilation based on selected compiler.
#define NAMESPACE_SPH_END
INLINE const T & asConst(T &ref)
Converts a non-const reference to const one.
typename TypeSelector< n, TArgs... >::Type SelectType
constexpr int getTypeIndex
typename UndecayType< T, TOther >::Type Undecay
typename ConvertToSizeType< T >::Type ConvertToSize
typename FunctionTraits< TFunction >::TReturnType ReturnType
typename WrapReferenceType< T >::Type WrapReference
typename MakeVoid< Ts... >::Type VoidType
Helper class for storing l-value references. Has a default constructor for convenient usage in contai...
ReferenceWrapper()=default
ReferenceWrapper(const ReferenceWrapper &other)
ReferenceWrapper & operator=(const ReferenceWrapper &other)
Overload of std::swap for Sph::Array.
Undecay< std::underlying_type_t< std::decay_t< T > >, T > Type
Converts all signed integral types and enums into Size, does not change other types.
typename FunctionSignature< TReturn(TArgs...)>::T TSignature
typename FunctionSignature< TReturn(TArgs...)>::T TSignature
typename FunctionSignature< TReturn(TArgs...)>::T TSignature
typename FunctionTraits< decltype(&TFunction::operator())>::TSignature TSignature
static constexpr bool value
static constexpr bool value
static constexpr bool value
static constexpr bool value
Returns the index of type T0 in type list. If the type is not in the list, returns -1.
static constexpr int value
Adds const or reference to the type, based on const-ness and reference-ness of given type.
Type trait for "extracting" stored references from reference_wrappers. Other types keeps unchanged.
Type trait wrapping references. Other types keeps unchanged.