[+] AuIsEqualOfEnum

[+] AuGetAmbiguousMethodNoArgs
[+] AuGetAmbiguousStaticFunction
[+] AuGetAmbiguousStaticFunctionNoArgs
This commit is contained in:
Reece Wilson 2024-05-29 13:24:08 +01:00
parent c5780976a1
commit f6bcade29c

View File

@ -447,6 +447,11 @@ static auto AuGetAmbiguousMethod2(Ret_t(T :: *a)(Args...))
return a;
}
template <class Ret_t, class ...Args>
static auto AuGetAmbiguousFunction2(Ret_t(*a)(Args...))
{
return a;
}
// According to MSVC: "only function types and reference types can't be const qualified"
@ -487,9 +492,10 @@ struct AuIsObject : AuBoolType<AuIsObject_v<T>>
// I dont think I can easily implement these in templates
// For the sake of syntax sugar, these will be macros for now
#define AuGetAmbiguousMethod(Ret_t, Args, T, Method) AuGetAmbiguousMethod2<Ret_t, T, AU_BRACKET_SCOPE Args >(&T::Method)
#define AuGetAmbiguousMethod_v AuGetAmbiguousMethod
#define AuGetAmbiguousMethod(Ret_t, Args, T, Method) AuGetAmbiguousMethod2<Ret_t, T, AU_BRACKET_SCOPE Args>(&T::Method)
#define AuGetAmbiguousMethodNoArgs(Ret_t, T, Method) AuGetAmbiguousMethod2<Ret_t, T> (&T::Method)
#define AuGetAmbiguousStaticFunction(Ret_t, Args, T, Func) AuGetAmbiguousFunction2<Ret_t, AU_BRACKET_SCOPE Args> (&T::Func)
#define AuGetAmbiguousStaticFunctionNoArgs(Ret_t, T, Func) AuGetAmbiguousFunction2<Ret_t> (&T::Func)
namespace _audetail
{
@ -819,4 +825,16 @@ struct AuIsNothrowDefaultConstructible : AuIsNothrowConstructible<T>
{ };
template <class T>
constexpr bool AuIsNothrowDefaultConstructible_v = AuIsNothrowDefaultConstructible<T>::value;
constexpr bool AuIsNothrowDefaultConstructible_v = AuIsNothrowDefaultConstructible<T>::value;
template <class T>
constexpr bool AuIsEqualOfEnum(T cmp)
{
return false;
}
template <class T, T e, T... args>
constexpr bool AuIsEqualOfEnum(T cmp)
{
return e == cmp || AuIsEqualOfEnum<T, args...>(cmp);
}