Added delay_type_t and type_at_t traits.
This commit is contained in:
parent
741ad4603f
commit
009113e566
@ -121,6 +121,24 @@ using copy_volatile_t = std::conditional_t<std::is_volatile_v<TFrom>, std::add_v
|
||||
template<typename TFrom, typename TTo>
|
||||
using copy_cv_t = copy_const_t<TFrom, copy_volatile_t<TFrom, TTo>>;
|
||||
|
||||
template<typename TActual, typename TDelay>
|
||||
using delay_type_t = TActual;
|
||||
|
||||
|
||||
template<std::size_t I, typename TArg, typename... TArgs>
|
||||
struct TypeAtHelper
|
||||
{
|
||||
using type_t = std::conditional_t<I == 0, TArg, TypeAtHelper<I-1, TArgs...>>;
|
||||
};
|
||||
|
||||
template<std::size_t I, typename TArg>
|
||||
struct TypeAtHelper<I, TArg>
|
||||
{
|
||||
using type_t = std::enable_if_t<I == 0, TArg>;
|
||||
};
|
||||
template<std::size_t I, typename... TArgs>
|
||||
using type_at_t = TypeAtHelper<I, TArgs...>::type_t;
|
||||
|
||||
//
|
||||
// public functions
|
||||
//
|
||||
|
Loading…
x
Reference in New Issue
Block a user