[*] Conformity - Clang Fixes

This commit is contained in:
Reece Wilson 2022-04-04 07:55:47 +01:00
parent f4f98cec83
commit 11ebcde5c2
6 changed files with 28 additions and 11 deletions

View File

@ -64,8 +64,8 @@ namespace __audetail
template <class T>
struct AuHasfind
{
template <class C> static constexpr AuTrueType Test(decltype(static_cast<C::const_iterator(C:: *)(const C::key_type &) const>(&C::find)));
template <class C> static constexpr AuTrueType Test(decltype(static_cast<C::const_iterator(C:: *)(const C::element_type &) const>(&C::find)));
template <class C> static constexpr AuTrueType Test(decltype(static_cast<typename C::const_iterator(C:: *)(const typename C::key_type &) const>(&C::find)));
template <class C> static constexpr AuTrueType Test(decltype(static_cast<typename C::const_iterator(C:: *)(const typename C::element_type &) const>(&C::find)));
template <class C> static constexpr AuFalseType Test(...);
using type = decltype(Test<T>(0));
};
@ -76,7 +76,7 @@ namespace __audetail
template <class T>
struct AuHasend
{
template <class C> static constexpr AuTrueType Test(decltype(static_cast<C::const_iterator(C:: *)() const>(&C::end)));
template <class C> static constexpr AuTrueType Test(decltype(static_cast<typename C::const_iterator(C:: *)() const>(&C::end)));
template <class C> static constexpr AuFalseType Test(...);
using type = decltype(Test<T>(0));
};

View File

@ -154,6 +154,10 @@ static void auline AuSafeDelete(T *in)
#endif
// TODO: Move me
#include "auOptional.hpp"
#include "auCastUtils.hpp"
namespace Aurora::Memory
{
#if defined(AURORA_ROXTL_ALLOCATORS_USE_STD)
@ -186,7 +190,7 @@ namespace Aurora::Memory
{
}
inline [[nodiscard]] constexpr T* allocate(Types::size_t n)
inline constexpr T* allocate(Types::size_t n)
{
if (auto p = (__FAlloc(n * sizeof(T), alignof(T))))
{

View File

@ -288,8 +288,8 @@ using AuEnableIf_t = typename AuEnableIf<Test, T>::type;
template <class T, class ... Args>
struct AuIsConstructible
{
template <class T, class ... Args> static constexpr AuTrueType Test(decltype(T(AuDeclVal<Args>()...)));
template <class T, class ... Args> static constexpr AuFalseType Test(...);
template <class C, class ... Args2> static constexpr AuTrueType Test(decltype(C(AuDeclVal<Args2>()...)));
static constexpr AuFalseType Test(...);
using type = decltype(Test<T, Args...>(0));
};

View File

@ -8,6 +8,11 @@
***/
#pragma once
#if defined(AURORA_COMPILER_CLANG)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wambiguous-ellipsis"
#endif
// primary
template <class>
@ -170,3 +175,7 @@ struct AuIsFunction<Ret(Args......) const volatile && noexcept> : AuTrueType {};
template <class T>
inline constexpr bool AuIsFunction_v = AuIsFunction<T>::value;
#if defined(AURORA_COMPILER_CLANG)
#pragma clang diagnostic pop
#endif

View File

@ -21,5 +21,9 @@ using AuPair = AURORA_RUNTIME_AU_PAIR<A_t, B_t>;
#define AURORA_RUNTIME_AU_TUPLE std::tuple
#endif
#if defined(AURORA_COMPILER_CLANG)
#define AuTuple std::tuple
#else
template <class... Types>
using AuTuple = AURORA_RUNTIME_AU_TUPLE<Types...>;
#endif

View File

@ -144,7 +144,7 @@ static constexpr AuTuple<Args&& ...> AuTupleForward(Args&& ... args)
// Stolen: https://codereview.stackexchange.com/questions/193420/apply-a-function-to-each-element-of-a-tuple-map-a-tuple
namespace __audetail
{
template <class Fn, typename Argument, AuUInt... Ns>
template <class Fn, class Argument, AuUInt... Ns>
static auto AuTupleTransformImpl(const Fn &fn, Argument &&argument, AuIndexSequence<Ns...>)
{
if constexpr (sizeof...(Ns) == 0)
@ -171,7 +171,7 @@ namespace __audetail
}
}
template <class Invokable, typename... Ts>
template <class Invokable, class... Ts>
static auto AuTupleTransform(const AuTuple<Ts...> &tuple, const Invokable &translate)
{
return __audetail::AuTupleTransformImpl(translate,