1 #ifndef SIPLASPLAS_UTILITY_IDENTITY_HPP 2 #define SIPLASPLAS_UTILITY_IDENTITY_HPP 25 constexpr
auto operator()(T&& value) -> decltype(std::forward<T>(value))
const 27 return std::forward<T>(value);
30 template<
typename T,
typename Function>
31 constexpr
auto type(Function callback) -> decltype(callback(meta::identity<T>()))
const 33 return callback(meta::identity<T>());
37 constexpr
auto type()
const 39 return meta::identity<T>();
43 inline auto applyIdentity(
const Identity& identity)
45 return [identity](
auto&& value)
47 return identity(std::forward<decltype(value)>(value));
51 template<
typename T,
typename Identity>
52 constexpr
auto applyIdentity(
const Identity& identity) -> meta::type_t<decltype(identity.template type<T>())>;
56 #endif // SIPLASPLAS_UTILITY_IDENTITY_HPP A functor class implementing the identity function.
Definition: identity.hpp:21
Definition: canary_allocator.hpp:7