Added delay_type_t and type_at_t traits.

This commit is contained in:
Patrick 2024-11-09 21:35:59 +01:00
parent 741ad4603f
commit 009113e566

View File

@ -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
//