[+] AuIsPair_v
[+] AuVoid_t
This commit is contained in:
parent
ce59f4c437
commit
58ffac4672
@ -300,6 +300,9 @@ struct AuRemoveExtent<T[Len]>
|
||||
template <class T>
|
||||
using AuRemoveExtent_t = typename AuRemoveExtent<T>::type;
|
||||
|
||||
template <class ... Ts>
|
||||
using AuVoid_t = void;
|
||||
|
||||
template <class>
|
||||
constexpr inline bool AuIsArray_v = false;
|
||||
|
||||
|
@ -36,6 +36,42 @@
|
||||
#define AURORA_RUNTIME_APPLY std::apply
|
||||
#endif
|
||||
|
||||
template<typename T, typename U = void>
|
||||
struct IsPairImpl : AuFalseType
|
||||
{ };
|
||||
|
||||
template<typename T>
|
||||
struct IsPairImpl <T, AuVoid_t<typename T::first_type,
|
||||
typename T::second_type,
|
||||
decltype(&T::first),
|
||||
decltype(&T::second)>> : AuTrueType
|
||||
{
|
||||
};
|
||||
|
||||
template <class T, class Enable = void>
|
||||
struct AuIsPair_C;
|
||||
|
||||
template <class T>
|
||||
struct AuIsPair_C<T, typename AuEnableIf_t<IsPairImpl<T>::value>>
|
||||
{
|
||||
using type = typename AuPair<typename T::first_type, typename T::second_type>;
|
||||
};
|
||||
|
||||
template <class T>
|
||||
struct AuIsPair_C<T, typename AuEnableIf_t<!IsPairImpl<T>::value>>
|
||||
{
|
||||
using type = void;
|
||||
};
|
||||
|
||||
template <class T>
|
||||
constexpr inline bool AuIsPair_v = AuIsSame_v<typename AuIsPair_C<AuRemoveCV_t<T>>::type, AuRemoveCV_t<T>>;
|
||||
|
||||
template <class... Args>
|
||||
static auto AuMakePair(Args&&... args)
|
||||
{
|
||||
return AURORA_RUNTIME_MAKE_PAIR(AuForward<Args>(args)...);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
struct AuIsTuple : AuFalseType
|
||||
{ };
|
||||
@ -47,12 +83,6 @@ struct AuIsTuple<AuTuple<Ts...>> : AuTrueType
|
||||
template <class T>
|
||||
inline constexpr bool AuIsTuple_v = AuIsTuple<T>::type::value;
|
||||
|
||||
template <class... Args>
|
||||
static auto AuMakePair(Args&&... args)
|
||||
{
|
||||
return AURORA_RUNTIME_MAKE_PAIR(AuForward<Args>(args)...);
|
||||
}
|
||||
|
||||
template <class... Args>
|
||||
static auto AuMakeTuple(Args&&... args)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user