Go to the documentation of this file.
9 #ifndef EAGINE_TYPE_IDENTITY_HPP
10 #define EAGINE_TYPE_IDENTITY_HPP
12 #include <type_traits>
26 typename = std::enable_if_t<std::is_same_v<T, X> && !std::is_array_v<X>>>
35 template <
typename T,
typename F>
38 static auto _get(X*) ->
typename X::type;
41 static auto _get(...) -> F;
43 using type = decltype(_get<T>(
static_cast<T*
>(
nullptr)));
48 template <
typename T,
typename F =
void>
49 using type_t =
typename get_type<T, F>::type;
60 #endif // EAGINE_TYPE_IDENTITY_HPP
Implementation detail of the type_t template.
Definition: type_identity.hpp:36
Common code is placed in this namespace.
Definition: eagine.hpp:21
std::remove_cv_t< T[C][R]> type
Alias for the argument of this template.
Definition: type_identity.hpp:21
Template type used mostly for function type-tag dispatching.
Definition: type_identity.hpp:19
constexpr auto operator()(X v) const -> X
Call operator returning a copy of its argument unchanged.
Definition: type_identity.hpp:27