[*] Fix some C++17 build regressions pending the merging of the TR1 / x03 to 14 headers

This commit is contained in:
Reece Wilson 2024-09-27 17:52:56 +01:00
parent 58a2456555
commit 0965d38675
32 changed files with 973 additions and 614 deletions

View File

@ -159,8 +159,14 @@
#if !defined(NO_C_CLASS_MACROS)
// C-like inline and static for classes/structures (hence the c-prefix... class)
#if !defined(cstatic)
#define cstatic inline static
#if defined(AU_LANG_CPP_17_)
#if !defined(cstatic)
#define cstatic inline static
#endif
#else
#if !defined(cstatic)
#define cstatic static
#endif
#endif
#if !defined(cinline)
@ -187,6 +193,86 @@
#endif
#endif
#if defined(AU_LANG_CPP_20_)
#define AU_EOB_LIKELY [[likely]]
#else
#define AU_EOB_LIKELY
#endif
#if defined(AU_LANG_CPP_20_)
#define AU_EOB_UNLIKELY [[unlikely]]
#else
#define AU_EOB_UNLIKELY
#endif
#if defined(AU_LANG_CPP_14_)
#define AU_CONSTEXPR_14 AUROXTL_CONSTEXPR
#define AU_INLINE_14 inline
#define AU_INLINE_OR_STATIC_14 inline
#else
#define AU_CONSTEXPR_14
#define AU_INLINE_14
#define AU_INLINE_OR_STATIC_14 static
#endif
#if defined(AU_LANG_CPP_17_)
#define AU_CONSTEXPR_17 AUROXTL_CONSTEXPR
#define AU_INLINE_17 inline
#define AU_INLINE_OR_STATIC_17 inline
#undef AU_CONSTEXPR_14
#define AU_CONSTEXPR_14 AUROXTL_CONSTEXPR
#undef AU_INLINE_14
#define AU_INLINE_14 inline
#undef AU_INLINE_OR_STATIC_14
#define AU_INLINE_OR_STATIC_14 inline
#else
#define AU_CONSTEXPR_17
#define AU_INLINE_17
#define AU_INLINE_OR_STATIC_17 static
#endif
#if defined(AU_LANG_CPP_20_)
#define AU_CONSTEXPR_20 AUROXTL_CONSTEXPR
#define AU_INLINE_20 inline
#define AU_INLINE_OR_STATIC_20 inline
#undef AU_CONSTEXPR_17
#define AU_CONSTEXPR_17 AUROXTL_CONSTEXPR
#undef AU_INLINE_17
#define AU_INLINE_17 inline
#undef AU_INLINE_OR_STATIC_17
#define AU_INLINE_OR_STATIC_17 inline
#else
#define AU_CONSTEXPR_20
#define AU_INLINE_20
#define AU_INLINE_OR_STATIC_20 static
#endif
#define AUROXTL_CONSTEXPR_14 AU_CONSTEXPR_14
#define AUROXTL_CONSTEXPR_17 AU_CONSTEXPR_17
#define AUROXTL_CONSTEXPR_20 AU_CONSTEXPR_20
#if defined(AU_LANG_CPP_20_)
#define AU_BIT_FIELD_AFTER_20(n) : n
#else
#define AU_BIT_FIELD_AFTER_20(n)
#endif
#if defined(AU_LANG_CPP_20_)
#define AU_BIT_FIELD_U32_AFTER_20 AuUInt32
#define AU_BIT_FIELD_U64_AFTER_20 AuUInt64
#define AU_BIT_FIELD_U64L_AFTER_20 AuUInt64
#else
#define AU_BIT_FIELD_U32_AFTER_20 AuUInt8
#define AU_BIT_FIELD_U64_AFTER_20 AuUInt8
#define AU_BIT_FIELD_U64L_AFTER_20 AuUInt16
#endif
#if defined(AU_LANG_CPP_20_)
#define AU_CO_ROUTINE_SUS_ALWAYS std::suspend_always
#else
#define AU_CO_ROUTINE_SUS_ALWAYS bool
#endif
#if defined(_AURORA_MISSING_STD_EXCEPTION)
#define AuStringException AuString

View File

@ -39,14 +39,14 @@ constexpr Iterator AuReverseIterator<Iterator>::Base() const
}
template<typename Iterator>
constexpr AuReverseIterator<Iterator>::reference AuReverseIterator<Iterator>::operator*() const
constexpr typename AuReverseIterator<Iterator>::reference AuReverseIterator<Iterator>::operator*() const
{
Iterator ret = iterator;
return *--ret;
}
template<typename Iterator>
constexpr AuReverseIterator<Iterator>::pointer AuReverseIterator<Iterator>::operator->() const
constexpr typename AuReverseIterator<Iterator>::pointer AuReverseIterator<Iterator>::operator->() const
{
Iterator ret = iterator;
--ret;
@ -116,7 +116,7 @@ constexpr AuReverseIterator<Iterator> &AuReverseIterator<Iterator>::operator-=(c
}
template<typename Iterator>
constexpr AuReverseIterator<Iterator>::reference AuReverseIterator<Iterator>::operator[](const difference_type offset) const
constexpr typename AuReverseIterator<Iterator>::reference AuReverseIterator<Iterator>::operator[](const difference_type offset) const
{
return iterator[static_cast<difference_type>(-offset - 1)];
}

View File

@ -16,15 +16,15 @@ struct AuUTF8Iterator
using pointer = typename std::iterator_traits<const char *>::pointer;
using reference = typename std::iterator_traits<const char *>::reference;
inline constexpr AuUTF8Iterator();
inline AUROXTL_CONSTEXPR_20 AuUTF8Iterator();
inline constexpr AuUTF8Iterator(const AuUTF8Iterator &copy);
inline AUROXTL_CONSTEXPR_20 AuUTF8Iterator(const AuUTF8Iterator &copy);
inline constexpr AuUTF8Iterator(AuUTF8Iterator &&copy);
inline AUROXTL_CONSTEXPR_20 AuUTF8Iterator(AuUTF8Iterator &&copy);
inline constexpr AuUTF8Iterator &operator =(const AuUTF8Iterator &copy);
inline AUROXTL_CONSTEXPR_20 AuUTF8Iterator &operator =(const AuUTF8Iterator &copy);
inline constexpr AuUTF8Iterator &operator =(AuUTF8Iterator &&move);
inline AUROXTL_CONSTEXPR_20 AuUTF8Iterator &operator =(AuUTF8Iterator &&move);
inline AuUTF8Iterator(const char *pStart);
@ -32,42 +32,42 @@ struct AuUTF8Iterator
cstatic AuUTF8Iterator FromStringView(AuROString in, AuUInt uOffset = AuROString::npos);
inline constexpr const char *base() const;
inline AUROXTL_CONSTEXPR_20 const char *base() const;
inline constexpr const char *Base() const;
inline AUROXTL_CONSTEXPR_20 const char *Base() const;
inline constexpr AuUTF8Iterator end() const;
inline AUROXTL_CONSTEXPR_20 AuUTF8Iterator end() const;
inline constexpr AuUTF8Iterator End() const;
inline AUROXTL_CONSTEXPR_20 AuUTF8Iterator End() const;
inline constexpr AuOptional<AuUInt32> operator*() const;
inline AUROXTL_CONSTEXPR_20 AuOptional<AuUInt32> operator*() const;
inline constexpr pointer operator->() const;
inline AUROXTL_CONSTEXPR_20 pointer operator->() const;
inline constexpr AuUTF8Iterator &operator++();
inline AUROXTL_CONSTEXPR_20 AuUTF8Iterator &operator++();
inline constexpr AuUTF8Iterator operator++(int);
inline AUROXTL_CONSTEXPR_20 AuUTF8Iterator operator++(int);
inline constexpr AuUTF8Iterator &operator--();
inline AUROXTL_CONSTEXPR_20 AuUTF8Iterator &operator--();
inline constexpr AuUTF8Iterator operator--(int);
inline AUROXTL_CONSTEXPR_20 AuUTF8Iterator operator--(int);
inline constexpr AuUTF8Iterator operator+(const difference_type offset) const;
inline AUROXTL_CONSTEXPR_20 AuUTF8Iterator operator+(const difference_type offset) const;
inline constexpr AuUTF8Iterator &operator+=(const difference_type offset);
inline AUROXTL_CONSTEXPR_20 AuUTF8Iterator &operator+=(const difference_type offset);
inline constexpr AuUTF8Iterator operator-(const difference_type offset) const;
inline AUROXTL_CONSTEXPR_20 AuUTF8Iterator operator-(const difference_type offset) const;
inline constexpr AuUTF8Iterator &operator-=(const difference_type offset);
inline AUROXTL_CONSTEXPR_20 AuUTF8Iterator &operator-=(const difference_type offset);
inline constexpr AuOptional<AuUInt32> operator[](const difference_type offset) const;
inline AUROXTL_CONSTEXPR_20 AuOptional<AuUInt32> operator[](const difference_type offset) const;
inline constexpr friend bool operator!=(AuUTF8Iterator a, AuUTF8Iterator b)
inline AUROXTL_CONSTEXPR_20 friend bool operator!=(AuUTF8Iterator a, AuUTF8Iterator b)
{
return a.base() != b.base();
}
inline constexpr friend bool operator==(AuUTF8Iterator a, AuUTF8Iterator b)
inline AUROXTL_CONSTEXPR_20 friend bool operator==(AuUTF8Iterator a, AuUTF8Iterator b)
{
return a.base() == b.base();
}

View File

@ -8,33 +8,33 @@
***/
#pragma once
inline constexpr AuUTF8Iterator::AuUTF8Iterator()
inline AUROXTL_CONSTEXPR_20 AuUTF8Iterator::AuUTF8Iterator()
{
}
inline constexpr AuUTF8Iterator::AuUTF8Iterator(const AuUTF8Iterator &copy) :
inline AUROXTL_CONSTEXPR_20 AuUTF8Iterator::AuUTF8Iterator(const AuUTF8Iterator &copy) :
baseView(copy.baseView),
pCurrent(copy.pCurrent)
{
}
inline constexpr AuUTF8Iterator::AuUTF8Iterator(AuUTF8Iterator &&copy) :
inline AUROXTL_CONSTEXPR_20 AuUTF8Iterator::AuUTF8Iterator(AuUTF8Iterator &&copy) :
baseView(copy.baseView),
pCurrent(copy.pCurrent)
{
}
inline constexpr AuUTF8Iterator &AuUTF8Iterator::operator =(const AuUTF8Iterator &copy)
inline AUROXTL_CONSTEXPR_20 AuUTF8Iterator &AuUTF8Iterator::operator =(const AuUTF8Iterator &copy)
{
this->baseView = copy.baseView;
this->baseView = copy.pCurrent;
return *this;
}
inline constexpr AuUTF8Iterator &AuUTF8Iterator::operator =(AuUTF8Iterator &&move)
inline AUROXTL_CONSTEXPR_20 AuUTF8Iterator &AuUTF8Iterator::operator =(AuUTF8Iterator &&move)
{
this->baseView = move.baseView;
this->pCurrent = move.pCurrent;
@ -71,17 +71,17 @@ AuUTF8Iterator AuUTF8Iterator::FromStringView(AuROString in, AuUInt uOffset)
return AuUTF8Iterator(in, uOffset);
}
inline constexpr const char *AuUTF8Iterator::base() const
inline AUROXTL_CONSTEXPR_20 const char *AuUTF8Iterator::base() const
{
return this->pCurrent;
}
inline constexpr const char *AuUTF8Iterator::Base() const
inline AUROXTL_CONSTEXPR_20 const char *AuUTF8Iterator::Base() const
{
return this->pCurrent;
}
inline constexpr AuUTF8Iterator AuUTF8Iterator::end() const
inline AUROXTL_CONSTEXPR_20 AuUTF8Iterator AuUTF8Iterator::end() const
{
AuUTF8Iterator ret;
ret.baseView = this->baseView;
@ -89,7 +89,7 @@ inline constexpr AuUTF8Iterator AuUTF8Iterator::end() const
return ret;
}
inline constexpr AuUTF8Iterator AuUTF8Iterator::End() const
inline AUROXTL_CONSTEXPR_20 AuUTF8Iterator AuUTF8Iterator::End() const
{
AuUTF8Iterator ret;
ret.baseView = this->baseView;
@ -97,7 +97,7 @@ inline constexpr AuUTF8Iterator AuUTF8Iterator::End() const
return ret;
}
inline constexpr AuOptional<AuUInt32> AuUTF8Iterator::operator*() const
inline AUROXTL_CONSTEXPR_20 AuOptional<AuUInt32> AuUTF8Iterator::operator*() const
{
auto pBegin = this->baseView.Begin();
auto uDiff = this->pCurrent - pBegin;
@ -114,12 +114,12 @@ inline constexpr AuOptional<AuUInt32> AuUTF8Iterator::operator*() const
return AuCodepointsDecodeOne(AuROString(pNext, uNext));
}
inline constexpr AuUTF8Iterator::pointer AuUTF8Iterator::operator->() const
inline AUROXTL_CONSTEXPR_20 AuUTF8Iterator::pointer AuUTF8Iterator::operator->() const
{
return this->base();
}
inline constexpr AuUTF8Iterator &AuUTF8Iterator::operator++()
inline AUROXTL_CONSTEXPR_20 AuUTF8Iterator &AuUTF8Iterator::operator++()
{
auto pBegin = this->baseView.Begin();
auto uDiff = this->pCurrent - pBegin;
@ -145,14 +145,14 @@ inline constexpr AuUTF8Iterator &AuUTF8Iterator::operator++()
return *this;
}
inline constexpr AuUTF8Iterator AuUTF8Iterator::operator++(int)
inline AUROXTL_CONSTEXPR_20 AuUTF8Iterator AuUTF8Iterator::operator++(int)
{
AuUTF8Iterator ret = *this;
++ret;
return ret;
}
inline constexpr AuUTF8Iterator &AuUTF8Iterator::operator--()
inline AUROXTL_CONSTEXPR_20 AuUTF8Iterator &AuUTF8Iterator::operator--()
{
auto pBegin = this->baseView.Begin();
auto uDiff = this->pCurrent - pBegin;
@ -179,21 +179,21 @@ inline constexpr AuUTF8Iterator &AuUTF8Iterator::operator--()
return *this;
}
inline constexpr AuUTF8Iterator AuUTF8Iterator::operator--(int)
inline AUROXTL_CONSTEXPR_20 AuUTF8Iterator AuUTF8Iterator::operator--(int)
{
AuUTF8Iterator ret = *this;
--ret;
return ret;
}
inline constexpr AuUTF8Iterator AuUTF8Iterator::operator+(const difference_type offset) const
inline AUROXTL_CONSTEXPR_20 AuUTF8Iterator AuUTF8Iterator::operator+(const difference_type offset) const
{
AuUTF8Iterator copy = *this;
copy += offset;
return copy;
}
inline constexpr AuUTF8Iterator &AuUTF8Iterator::operator+=(const difference_type offset)
inline AUROXTL_CONSTEXPR_20 AuUTF8Iterator &AuUTF8Iterator::operator+=(const difference_type offset)
{
auto pBegin = this->baseView.Begin();
auto uDiff = this->pCurrent - pBegin;
@ -232,14 +232,14 @@ inline constexpr AuUTF8Iterator &AuUTF8Iterator::operator+=(const difference_typ
return *this;
}
inline constexpr AuUTF8Iterator AuUTF8Iterator::operator-(const difference_type offset) const
inline AUROXTL_CONSTEXPR_20 AuUTF8Iterator AuUTF8Iterator::operator-(const difference_type offset) const
{
AuUTF8Iterator copy = *this;
copy -= offset;
return copy;
}
inline constexpr AuUTF8Iterator &AuUTF8Iterator::operator-=(const difference_type offset)
inline AUROXTL_CONSTEXPR_20 AuUTF8Iterator &AuUTF8Iterator::operator-=(const difference_type offset)
{
auto pBegin = this->baseView.Begin();
auto uDiff = this->pCurrent - pBegin;
@ -275,7 +275,7 @@ inline constexpr AuUTF8Iterator &AuUTF8Iterator::operator-=(const difference_typ
return *this;
}
inline constexpr AuOptional<AuUInt32> AuUTF8Iterator::operator[](const difference_type offset) const
inline AUROXTL_CONSTEXPR_20 AuOptional<AuUInt32> AuUTF8Iterator::operator[](const difference_type offset) const
{
auto ret = *this;
ret += offset;

View File

@ -144,18 +144,21 @@
//
#if defined(AURORA_ROXTL_HAS_RUNTIME) && AURORA_ROXTL_HAS_RUNTIME
namespace Aurora::Memory
namespace Aurora
{
namespace Memory
{
AuHeap *GetDefaultDiscontiguousHeap();
}
}
#endif
namespace __audetail
{
#if defined(AURORA_ROXTL_HAS_RUNTIME) && AURORA_ROXTL_HAS_RUNTIME
inline AuHeap *gDefaultDiscontiguousHeap = Aurora::Memory::GetDefaultDiscontiguousHeap();
AU_INLINE_OR_STATIC_17 AuHeap *gDefaultDiscontiguousHeap = Aurora::Memory::GetDefaultDiscontiguousHeap();
#else
inline AuHeap *gDefaultDiscontiguousHeap = &gDefaultDummyHeap;
AU_INLINE_OR_STATIC_17 AuHeap *gDefaultDiscontiguousHeap = &gDefaultDummyHeap;
#endif
}

View File

@ -355,31 +355,31 @@ constexpr AuMemoryView<Readonly_b>::operator bool() const
}
template<bool Readonly_b>
constexpr AuMemoryView<Readonly_b>::U8_t AuMemoryView<Readonly_b>::ToPointer() const
constexpr typename AuMemoryView<Readonly_b>::U8_t AuMemoryView<Readonly_b>::ToPointer() const
{
return this->ptrU8;
}
template<bool Readonly_b>
constexpr AuMemoryView<Readonly_b>::U8_t AuMemoryView<Readonly_b>::begin() const
constexpr typename AuMemoryView<Readonly_b>::U8_t AuMemoryView<Readonly_b>::begin() const
{
return this->ptrU8;
}
template<bool Readonly_b>
constexpr AuMemoryView<Readonly_b>::U8_t AuMemoryView<Readonly_b>::end() const
constexpr typename AuMemoryView<Readonly_b>::U8_t AuMemoryView<Readonly_b>::end() const
{
return this->ptrU8 + this->length;
}
template<bool Readonly_b>
constexpr AuMemoryView<Readonly_b>::U8_t AuMemoryView<Readonly_b>::Begin() const
constexpr typename AuMemoryView<Readonly_b>::U8_t AuMemoryView<Readonly_b>::Begin() const
{
return this->ptrU8;
}
template<bool Readonly_b>
constexpr AuMemoryView<Readonly_b>::U8_t AuMemoryView<Readonly_b>::End() const
constexpr typename AuMemoryView<Readonly_b>::U8_t AuMemoryView<Readonly_b>::End() const
{
return this->ptrU8 + this->length;
}

View File

@ -12,127 +12,127 @@ namespace __audetail
template <class T>
struct AuHasSetAllocatorRawVoid
{
template <class C> static constexpr AuTrueType Test(decltype(static_cast<void (C:: *)(AuHeap *)>(&C::SetAllocator)));
template <class C> static constexpr AuFalseType Test(...);
template <class C> static AUROXTL_CONSTEXPR_17 AuTrueType Test(decltype(static_cast<void (C:: *)(AuHeap *)>(&C::SetAllocator)));
template <class C> static AUROXTL_CONSTEXPR_17 AuFalseType Test(...);
using type = decltype(Test<T>(0));
};
template <class T>
struct AuHasSetAllocatorRawBool
{
template <class C> static constexpr AuTrueType Test(decltype(static_cast<bool (C:: *)(AuHeap *)>(&C::SetAllocator)));
template <class C> static constexpr AuFalseType Test(...);
template <class C> static AUROXTL_CONSTEXPR_17 AuTrueType Test(decltype(static_cast<bool (C:: *)(AuHeap *)>(&C::SetAllocator)));
template <class C> static AUROXTL_CONSTEXPR_17 AuFalseType Test(...);
using type = decltype(Test<T>(0));
};
template <class T>
struct AuHasSetHeapRawVoid
{
template <class C> static constexpr AuTrueType Test(decltype(static_cast<void (C:: *)(AuHeap *)>(&C::SetHeap)));
template <class C> static constexpr AuFalseType Test(...);
template <class C> static AUROXTL_CONSTEXPR_17 AuTrueType Test(decltype(static_cast<void (C:: *)(AuHeap *)>(&C::SetHeap)));
template <class C> static AUROXTL_CONSTEXPR_17 AuFalseType Test(...);
using type = decltype(Test<T>(0));
};
template <class T>
struct AuHasSetHeapRawBool
{
template <class C> static constexpr AuTrueType Test(decltype(static_cast<bool (C:: *)(AuHeap *)>(&C::SetHeap)));
template <class C> static constexpr AuFalseType Test(...);
template <class C> static AUROXTL_CONSTEXPR_17 AuTrueType Test(decltype(static_cast<bool (C:: *)(AuHeap *)>(&C::SetHeap)));
template <class C> static AUROXTL_CONSTEXPR_17 AuFalseType Test(...);
using type = decltype(Test<T>(0));
};
template <class T>
struct AuHasSetAllocatorSVoid
{
template <class C> static constexpr AuTrueType Test(decltype(static_cast<void (C:: *)(AuSPtr<AuHeap>)>(&C::SetAllocator)));
template <class C> static constexpr AuTrueType Test(decltype(static_cast<void (C:: *)(const AuSPtr<AuHeap> &)>(&C::SetAllocator)));
template <class C> static constexpr AuFalseType Test(...);
template <class C> static AUROXTL_CONSTEXPR_17 AuTrueType Test(decltype(static_cast<void (C:: *)(AuSPtr<AuHeap>)>(&C::SetAllocator)));
template <class C> static AUROXTL_CONSTEXPR_17 AuTrueType Test(decltype(static_cast<void (C:: *)(const AuSPtr<AuHeap> &)>(&C::SetAllocator)));
template <class C> static AUROXTL_CONSTEXPR_17 AuFalseType Test(...);
using type = decltype(Test<T>(0));
};
template <class T>
struct AuHasSetAllocatorSBool
{
template <class C> static constexpr AuTrueType Test(decltype(static_cast<bool (C:: *)(AuSPtr<AuHeap>)>(&C::SetAllocator)));
template <class C> static constexpr AuTrueType Test(decltype(static_cast<bool (C:: *)(const AuSPtr<AuHeap> &)>(&C::SetAllocator)));
template <class C> static constexpr AuFalseType Test(...);
template <class C> static AUROXTL_CONSTEXPR_17 AuTrueType Test(decltype(static_cast<bool (C:: *)(AuSPtr<AuHeap>)>(&C::SetAllocator)));
template <class C> static AUROXTL_CONSTEXPR_17 AuTrueType Test(decltype(static_cast<bool (C:: *)(const AuSPtr<AuHeap> &)>(&C::SetAllocator)));
template <class C> static AUROXTL_CONSTEXPR_17 AuFalseType Test(...);
using type = decltype(Test<T>(0));
};
template <class T>
struct AuHasSetHeapSVoid
{
template <class C> static constexpr AuTrueType Test(decltype(static_cast<void (C:: *)(AuSPtr<AuHeap>)>(&C::SetHeap)));
template <class C> static constexpr AuTrueType Test(decltype(static_cast<void (C:: *)(const AuSPtr<AuHeap> &)>(&C::SetHeap)));
template <class C> static constexpr AuFalseType Test(...);
template <class C> static AUROXTL_CONSTEXPR_17 AuTrueType Test(decltype(static_cast<void (C:: *)(AuSPtr<AuHeap>)>(&C::SetHeap)));
template <class C> static AUROXTL_CONSTEXPR_17 AuTrueType Test(decltype(static_cast<void (C:: *)(const AuSPtr<AuHeap> &)>(&C::SetHeap)));
template <class C> static AUROXTL_CONSTEXPR_17 AuFalseType Test(...);
using type = decltype(Test<T>(0));
};
template <class T>
struct AuHasSetHeapSBool
{
template <class C> static constexpr AuTrueType Test(decltype(static_cast<bool (C:: *)(AuSPtr<AuHeap>)>(&C::SetHeap)));
template <class C> static constexpr AuTrueType Test(decltype(static_cast<bool (C:: *)(const AuSPtr<AuHeap> &)>(&C::SetHeap)));
template <class C> static constexpr AuFalseType Test(...);
template <class C> static AUROXTL_CONSTEXPR_17 AuTrueType Test(decltype(static_cast<bool (C:: *)(AuSPtr<AuHeap>)>(&C::SetHeap)));
template <class C> static AUROXTL_CONSTEXPR_17 AuTrueType Test(decltype(static_cast<bool (C:: *)(const AuSPtr<AuHeap> &)>(&C::SetHeap)));
template <class C> static AUROXTL_CONSTEXPR_17 AuFalseType Test(...);
using type = decltype(Test<T>(0));
};
template <class T>
struct AuHasSetHeapSharedSVoid
{
template <class C> static constexpr AuTrueType Test(decltype(static_cast<void (C:: *)(AuSPtr<AuHeap>)>(&C::SetHeapShared)));
template <class C> static constexpr AuTrueType Test(decltype(static_cast<void (C:: *)(const AuSPtr<AuHeap> &)>(&C::SetHeapShared)));
template <class C> static constexpr AuFalseType Test(...);
template <class C> static AUROXTL_CONSTEXPR_17 AuTrueType Test(decltype(static_cast<void (C:: *)(AuSPtr<AuHeap>)>(&C::SetHeapShared)));
template <class C> static AUROXTL_CONSTEXPR_17 AuTrueType Test(decltype(static_cast<void (C:: *)(const AuSPtr<AuHeap> &)>(&C::SetHeapShared)));
template <class C> static AUROXTL_CONSTEXPR_17 AuFalseType Test(...);
using type = decltype(Test<T>(0));
};
template <class T>
struct AuHasSetHeapSharedSBool
{
template <class C> static constexpr AuTrueType Test(decltype(static_cast<bool (C:: *)(AuSPtr<AuHeap>)>(&C::SetHeapShared)));
template <class C> static constexpr AuTrueType Test(decltype(static_cast<bool (C:: *)(const AuSPtr<AuHeap> &)>(&C::SetHeapShared)));
template <class C> static constexpr AuFalseType Test(...);
template <class C> static AUROXTL_CONSTEXPR_17 AuTrueType Test(decltype(static_cast<bool (C:: *)(AuSPtr<AuHeap>)>(&C::SetHeapShared)));
template <class C> static AUROXTL_CONSTEXPR_17 AuTrueType Test(decltype(static_cast<bool (C:: *)(const AuSPtr<AuHeap> &)>(&C::SetHeapShared)));
template <class C> static AUROXTL_CONSTEXPR_17 AuFalseType Test(...);
using type = decltype(Test<T>(0));
};
template <class T>
struct AuHasAllocatorType
{
template <class C> static constexpr AuTrueType Test(typename C::allocator_type *);
template <class C> static constexpr AuFalseType Test(...);
template <class C> static AUROXTL_CONSTEXPR_17 AuTrueType Test(typename C::allocator_type *);
template <class C> static AUROXTL_CONSTEXPR_17 AuFalseType Test(...);
using type = decltype(Test<T>(0));
};
template <class T>
constexpr inline bool AuHasSetAllocatorRawVoid_v = AuHasSetAllocatorRawVoid<T>::type::value;
static AUROXTL_CONSTEXPR_17 bool AuHasSetAllocatorRawVoid_v = AuHasSetAllocatorRawVoid<T>::type::value;
template <class T>
constexpr inline bool AuHasSetAllocatorRawBool_v = AuHasSetAllocatorRawBool<T>::type::value;
static AUROXTL_CONSTEXPR_17 bool AuHasSetAllocatorRawBool_v = AuHasSetAllocatorRawBool<T>::type::value;
template <class T>
constexpr inline bool AuHasSetAllocatorSharedVoid_v = AuHasSetAllocatorSVoid<T>::type::value;
static AUROXTL_CONSTEXPR_17 bool AuHasSetAllocatorSharedVoid_v = AuHasSetAllocatorSVoid<T>::type::value;
template <class T>
constexpr inline bool AuHasSetAllocatorSharedBool_v = AuHasSetAllocatorSBool<T>::type::value;
static AUROXTL_CONSTEXPR_17 bool AuHasSetAllocatorSharedBool_v = AuHasSetAllocatorSBool<T>::type::value;
template <class T>
constexpr inline bool AuHasSetHeapRawVoid_v = AuHasSetHeapRawVoid<T>::type::value;
static AUROXTL_CONSTEXPR_17 bool AuHasSetHeapRawVoid_v = AuHasSetHeapRawVoid<T>::type::value;
template <class T>
constexpr inline bool AuHasSetHeapRawBool_v = AuHasSetHeapRawBool<T>::type::value;
static AUROXTL_CONSTEXPR_17 bool AuHasSetHeapRawBool_v = AuHasSetHeapRawBool<T>::type::value;
template <class T>
constexpr inline bool AuHasSetHeapSharedVoid_v = AuHasSetHeapSVoid<T>::type::value;
static AUROXTL_CONSTEXPR_17 bool AuHasSetHeapSharedVoid_v = AuHasSetHeapSVoid<T>::type::value;
template <class T>
constexpr inline bool AuHasSetHeapSharedBool_v = AuHasSetHeapSBool<T>::type::value;
static AUROXTL_CONSTEXPR_17 bool AuHasSetHeapSharedBool_v = AuHasSetHeapSBool<T>::type::value;
template <class T>
constexpr inline bool AuHasSetHeapSharedSharedVoid_v = AuHasSetHeapSharedSVoid<T>::type::value;
static AUROXTL_CONSTEXPR_17 bool AuHasSetHeapSharedSharedVoid_v = AuHasSetHeapSharedSVoid<T>::type::value;
template <class T>
constexpr inline bool AuHasSetHeapSharedSharedBool_v = AuHasSetHeapSharedSBool<T>::type::value;
static AUROXTL_CONSTEXPR_17 bool AuHasSetHeapSharedSharedBool_v = AuHasSetHeapSharedSBool<T>::type::value;
template <class T>
constexpr inline bool AuHasAllocatorType_v = AuHasAllocatorType<T>::type::value;
static AUROXTL_CONSTEXPR_17 bool AuHasAllocatorType_v = AuHasAllocatorType<T>::type::value;
}
template <typename T>

View File

@ -61,6 +61,7 @@ void Swap(AuUniquePointer<T, Deleter_t> &lhs, AuUniquePointer<T, Deleter_t> &rhs
lhs.swap(rhs);
}
#if defined(AU_LANG_CPP_17_)
namespace std
{
template <typename T, typename Deleter_t>
@ -68,4 +69,5 @@ namespace std
{
lhs.swap(rhs);
}
}
}
#endif

View File

@ -35,10 +35,13 @@ static void AuResetMember(AuSPtr<T> &ref)
ref.reset();
}
namespace Aurora::Memory
namespace Aurora
{
namespace Memory
{
struct ByteBuffer;
}
}
template <class T>
static void AuResetMember(Aurora::Memory::ByteBuffer &ref);

View File

@ -14,35 +14,35 @@ namespace AuUtil
template <class T>
struct AuHasDestroy
{
template <class C> static constexpr AuTrueType Test(decltype(&C::DestroyPrivate));
template <class C> static constexpr AuFalseType Test(...);
template <class C> static AUROXTL_CONSTEXPR_17 AuTrueType Test(decltype(&C::DestroyPrivate));
template <class C> static AUROXTL_CONSTEXPR_17 AuFalseType Test(...);
using type = decltype(Test<T>(0));
};
template <class T>
struct AuHasDeconstruct
{
template <class C> static constexpr AuTrueType Test(decltype(&C::DeconstructPrivate));
template <class C> static constexpr AuFalseType Test(...);
template <class C> static AUROXTL_CONSTEXPR_17 AuTrueType Test(decltype(&C::DeconstructPrivate));
template <class C> static AUROXTL_CONSTEXPR_17 AuFalseType Test(...);
using type = decltype(Test<T>(0));
};
template <class T>
struct AuHasPreDeconstruct
{
template <class C> static constexpr AuTrueType Test(decltype(&C::PreDeconstructPrivate));
template <class C> static constexpr AuFalseType Test(...);
template <class C> static AUROXTL_CONSTEXPR_17 AuTrueType Test(decltype(&C::PreDeconstructPrivate));
template <class C> static AUROXTL_CONSTEXPR_17 AuFalseType Test(...);
using type = decltype(Test<T>(0));
};
template <class T>
constexpr inline bool AuHasDestroy_v = AuHasDestroy<T>::type::value;
static AUROXTL_CONSTEXPR_17 bool AuHasDestroy_v = AuHasDestroy<T>::type::value;
template <class T>
constexpr inline bool AuHasDesconstruct_v = AuHasDeconstruct<T>::type::value;
static AUROXTL_CONSTEXPR_17 bool AuHasDesconstruct_v = AuHasDeconstruct<T>::type::value;
template <class T>
constexpr inline bool AuHasPreDesconstruct_v = AuHasPreDeconstruct<T>::type::value;
static AUROXTL_CONSTEXPR_17 bool AuHasPreDesconstruct_v = AuHasPreDeconstruct<T>::type::value;
}
#if !defined(__ROXTL_FORCE_SAFE_DESTROY_FORCE_CLEAR)

View File

@ -10,7 +10,9 @@
//#include <auROXTL/auCastUtils.hpp>
#include <auROXTL/auCopyMoveUtils.hpp>
namespace Aurora::Memory
namespace Aurora
{
namespace Memory
{
inline void ThrowNullException();
@ -30,7 +32,7 @@ namespace Aurora::Memory
}
};
inline IPtrNoOpGet gNoop;
AU_INLINE_OR_STATIC_17 IPtrNoOpGet gNoop;
}
template <class TType_t, class Base_t>
@ -40,7 +42,13 @@ namespace Aurora::Memory
#endif
{
using element_type = typename Base_t::element_type;
#if defined(AU_LANG_CPP_17_)
using weak_type = typename Base_t::weak_type;
#else
using weak_type = std::weak_ptr<element_type>;
#endif
using base_type = Base_t;
using Base_t::Base_t;
@ -334,7 +342,7 @@ namespace Aurora::Memory
ADD_OPERATOR(==)
ADD_OPERATOR(!=)
#if defined(AU_LANG_CPP_20)
#if defined(AU_LANG_CPP_20_)
template < class T >
std::strong_ordering operator<=>(const T &rhs) noexcept
{
@ -344,7 +352,7 @@ namespace Aurora::Memory
ADD_OPERATOR(>)
ADD_OPERATOR(<)
ADD_OPERATOR(<=)
ADD_OPERATOR(=>)
//ADD_OPERATOR(=>)
#endif
private:
@ -375,7 +383,10 @@ namespace Aurora::Memory
#elif defined(_AURORA_NULLEXPT_BRANCH_NO_BAD_SHARED_STRUCT)
auline void throwif() const
{
if (!Base_t::operator bool()) [[likely]]
if (!Base_t::operator bool())
#if defined(AU_LANG_CPP_20_)
[[unlikely]]
#endif
{
AU_THROW_STRING("ExSharedPointer Null Access Violation");
}
@ -391,7 +402,10 @@ namespace Aurora::Memory
if (!cached) [[unlikely]]
{
#if defined(_AURORA_NULLEXPT_BRANCH_BUG_CHECK)
if (!Base_t::operator bool()) [[likely]]
if (!Base_t::operator bool())
#if defined(AU_LANG_CPP_20_)
[[unlikely]]
#endif
#endif
{
AU_THROW_STRING("ExSharedPointer Null Access Violation");
@ -414,4 +428,5 @@ namespace Aurora::Memory
return Base_t::shared_from_this();
}
};
}
}

View File

@ -33,117 +33,117 @@
#pragma once
/// Try decode UTF32 codepoint from UTF8 sequence
static constexpr AuOptional<AuUInt32> AuCodepointsDecodeOne(const AuROString &in);
static AUROXTL_CONSTEXPR_17 AuOptional<AuUInt32> AuCodepointsDecodeOne(const AuROString &in);
/// Try decode all UTF32 codepoints from UTF8 sequence
static AuList<AuUInt32> AuCodepointsDecode(const AuROString &in);
static AuList<AuUInt32> AuCodepointsDecode(const AuROString &in);
/// Try encode one UTF8 codepoint into a string buffer
static void AuCodepointsEncodeInto(AuUInt32 uCodepoint,
AuString &out);
static void AuCodepointsEncodeInto(AuUInt32 uCodepoint,
AuString &out);
/// Similar to AuCodepointsIsEqualIgnoreCase, translates all ASCII English characters to their AuToLower counterparts.
/// No localization complexities are, will, or should be involved.
static auline AuString AuCodepointsToLower(const AuROString &in);
static auline AuString AuCodepointsToLower(const AuROString &in);
/// Similar to AuCodepointsIsEqualIgnoreCase, translates all ASCII English characters to their AuToUpper counterparts.
/// No localization complexities are, will, or should be involved.
static auline AuString AuCodepointsToUpper(const AuROString &in);
static auline AuString AuCodepointsToUpper(const AuROString &in);
/// Counts the UTF8/UTF32 codepoints in a byte sequence
static auline constexpr CodepointOffset_t AuCodepointsCount(const AuROString &in);
static auline AUROXTL_CONSTEXPR_17 CodepointOffset_t AuCodepointsCount(const AuROString &in);
/// Counts the bytes required to iterate over a UTF8 encoded codepoint
static auline constexpr CodepointByteOffset_t AuCodepointsNextLength(const AuROString &in);
static auline AUROXTL_CONSTEXPR_17 CodepointByteOffset_t AuCodepointsNextLength(const AuROString &in);
/// Iterates over a UTF8 sequence using OP.
/// If op returns void, AuCodepointsForEach will continue until EOS or invalid squence.
/// If op returns bool, AuCodepointsForEach will continue until EOS, invalid squence, or !op.
/// Returns false on invalid sequence or user break, otherwise returns true.
template <class T>
static bool AuCodepointsForEach(T op, const AuROString &in);
static bool AuCodepointsForEach(T op, const AuROString &in);
/// Translates the in UTF8 sequence using a transformer of U32(*fMyUTF32Translator)(U32)
template <class T>
static AuString AuCodepointsTransform(T op, const AuROString &in);
static AuString AuCodepointsTransform(T op, const AuROString &in);
/// Translates the in UTF8 sequence using a transformer of U8(*fMyASCIITranslator)(U8)
template <class T>
AuString AuCodepointsTransformASCIIOp(T op, const AuROString &in);
AuString AuCodepointsTransformASCIIOp(T op, const AuROString &in);
/// Performs a memcmp on unknown chunks, performs a memcmp for each UTF8 sequence of bytes, and performs a AuToLower(a) != AuToLower(b) operation on any ASCII English characters.
/// Also see: AuCodepointsStartsWithEqualIgnoreCase, AuCodepointsEndsWithEqualIgnoreCase
static bool AuCodepointsIsEqualIgnoreCase(const AuROString &inA,
const AuROString &inB);
static bool AuCodepointsIsEqualIgnoreCase(const AuROString &inA,
const AuROString &inB);
/// Performs a memcmp on unknown chunks, performs a memcmp for each UTF8 sequence of bytes, and performs a AuToLower(a) != AuToLower(b) operation on any ASCII English characters.
/// Also see: AuCodepointsIsEqualIgnoreCase, AuCodepointsEndsWithEqualIgnoreCase
static bool AuCodepointsStartsWithEqualIgnoreCase(const AuROString &inA,
const AuROString &inB);
static bool AuCodepointsStartsWithEqualIgnoreCase(const AuROString &inA,
const AuROString &inB);
/// Also see: AuCodepointsIsEqualIgnoreCase, AuCodepointsStartsWithEqualIgnoreCase
static bool AuCodepointsEndsWithEqualIgnoreCase(const AuROString &inA,
const AuROString &inB);
static bool AuCodepointsEndsWithEqualIgnoreCase(const AuROString &inA,
const AuROString &inB);
/// Returns the byte offset of the codepoint index or AuROString::npos
static auline constexpr CodepointByteOffset_t AuCodepointsGetByteOffset(const AuROString &in,
CodepointOffset_t uCodepointIndex);
static auline AUROXTL_CONSTEXPR_17 CodepointByteOffset_t AuCodepointsGetByteOffset(const AuROString &in,
CodepointOffset_t uCodepointIndex);
/// Returns the length of the codepoint index in bytes or AuROString::npos
static auline constexpr CodepointByteOffset_t AuCodepointsGetByteLength(const AuROString &in,
CodepointOffset_t uCodepointIndex);
static auline AUROXTL_CONSTEXPR_17 CodepointByteOffset_t AuCodepointsGetByteLength(const AuROString &in,
CodepointOffset_t uCodepointIndex);
/// Finds subpattern in value at codepoint offset, returning bool
static bool AuCodepointsContains(const AuROString &value,
const AuROString &subpattern,
CodepointOffset_t uStartPosition = {});
static bool AuCodepointsContains(const AuROString &value,
const AuROString &subpattern,
CodepointOffset_t uStartPosition = {});
/// Performs a terribly inefficient find in sequence operation.
/// Returns the byte offset for find in in starting at uStartPosition bytes, or AuROString::npos
/// Assuming the in sequence is valid, you can use other traditional binary methods.
/// UTF8 sets the higher most bits to signify multibyte sequence position; you can arbitrarily scan for a complete sequences of UTF8 characters in a legal buffer without any special logic.
static CodepointByteOffset_t AuCodepointsFindByteOffset(const AuROString &in,
const AuROString &find,
CodepointByteOffset_t uStartPosition = {});
static CodepointByteOffset_t AuCodepointsFindByteOffset(const AuROString &in,
const AuROString &find,
CodepointByteOffset_t uStartPosition = {});
/// AuCodepointsFindByteOffset same as above (AuCodepointsFindByteOffset), slightly less dumb, but still too bloated.
/// The main difference is that uStartPosition is trusted to be a valid start offset.
/// Worst thing about this is, assuming a valid string view, we don't need to worry about testing the validity of the previous bytes (<uStartPosition), or even the current codepoint byte offset (uStartPosition).
static constexpr CodepointByteOffset_t AuCodepointsFindByteOffsetUnsafe(const AuROString &in,
const AuROString &find,
CodepointByteOffset_t uStartPosition);
static AUROXTL_CONSTEXPR_17 CodepointByteOffset_t AuCodepointsFindByteOffsetUnsafe(const AuROString &in,
const AuROString &find,
CodepointByteOffset_t uStartPosition);
/// An inefficient seek backwards to byte offset given an arbitrary codepoint offset.
/// Returns byte offset for codepoint offset - 1 or AuROString::npos
static constexpr CodepointByteOffset_t AuCodepointsFindPreviousValidByteOffsetFromOffset(const AuROString &in,
CodepointOffset_t uStartPosition = {});
static AUROXTL_CONSTEXPR_17 CodepointByteOffset_t AuCodepointsFindPreviousValidByteOffsetFromOffset(const AuROString &in,
CodepointOffset_t uStartPosition = {});
/// An efficient seek backwards to byte offset given an arbitrary codepoint byte offset.
/// Returns byte offset for codepoint byte offset - 1 or AuROString::npos
static constexpr CodepointByteOffset_t AuCodepointsFindPreviousValidByteOffsetFromByteOffset(const AuROString &in,
CodepointByteOffset_t uStartPosition = {});
static AUROXTL_CONSTEXPR_17 CodepointByteOffset_t AuCodepointsFindPreviousValidByteOffsetFromByteOffset(const AuROString &in,
CodepointByteOffset_t uStartPosition = {});
static constexpr CodepointOffset_t AuCodepointsFindCodepointOffset(const AuROString &in,
CodepointByteOffset_t uBytePosition);
static AUROXTL_CONSTEXPR_17 CodepointOffset_t AuCodepointsFindCodepointOffset(const AuROString &in,
CodepointByteOffset_t uBytePosition);
/// Finds subpattern in value at codepoint offset, returning a codepoint offset or AuROString::npos
static CodepointOffset_t AuCodepointsFindCodepointOffset(const AuROString &in,
const AuROString &find,
CodepointOffset_t uStartPosition = {});
static CodepointOffset_t AuCodepointsFindCodepointOffset(const AuROString &in,
const AuROString &find,
CodepointOffset_t uStartPosition = {});
/// For a given valid UTF8 string view, provides the delta byte offset or AuROString::npos, to delete the last most codepoint
static constexpr AuUInt AuCodepointsReverseIterate(const AuROString &string);
static AUROXTL_CONSTEXPR_17 AuUInt AuCodepointsReverseIterate(const AuROString &string);
/// For a given valid UTF8 string view, to delete the last most codepoint, this provides a view with the suffix removed or an empty view.
static constexpr AuROString AuCodepointsReverseIterateSubStrPrefixView(const AuROString &string);
static AUROXTL_CONSTEXPR_17 AuROString AuCodepointsReverseIterateSubStrPrefixView(const AuROString &string);
/// For a given valid UTF8 string view, to delete the last most codepoint, this provides a view with the just suffix to be removed or an empty view.
static constexpr AuROString AuCodepointsReverseIterateSubStrSuffixView(const AuROString &string);
static AUROXTL_CONSTEXPR_17 AuROString AuCodepointsReverseIterateSubStrSuffixView(const AuROString &string);
static AuString & AuCodepointsReplaceAll(AuString &str,
const AuROString &from,
const AuROString &to);
static AuString & AuCodepointsReplaceAll(AuString &str,
const AuROString &from,
const AuROString &to);
static AuList<AuROString> AuCodepointsSplitString(const AuROString &str,
const AuROString &delim,
bool bIgnoreEmpty = true);
static AuList<AuROString> AuCodepointsSplitString(const AuROString &str,
const AuROString &delim,
bool bIgnoreEmpty = true);

View File

@ -30,7 +30,7 @@
#pragma once
/// Try decode UTF32 codepoint from UTF8 sequence
static constexpr AuOptional<AuUInt32> AuCodepointsDecodeOne(const AuROString &in)
static AUROXTL_CONSTEXPR_17 AuOptional<AuUInt32> AuCodepointsDecodeOne(const AuROString &in)
{
if (in.empty())
{
@ -240,7 +240,7 @@ static auline AuString AuCodepointsToUpper(const AuROString &in)
}
/// Counts the UTF8/UTF32 codepoints in a byte sequence
static auline constexpr CodepointOffset_t AuCodepointsCount(const AuROString &in)
static auline AUROXTL_CONSTEXPR_17 CodepointOffset_t AuCodepointsCount(const AuROString &in)
{
CodepointOffset_t uCounter {};
auto uLength = in.length();
@ -323,7 +323,7 @@ static auline constexpr CodepointOffset_t AuCodepointsCount(const AuROString
}
/// Counts the bytes required to iterate over a UTF8 encoded codepoint
static auline constexpr CodepointByteOffset_t AuCodepointsNextLength(const AuROString &in)
static auline AUROXTL_CONSTEXPR_17 CodepointByteOffset_t AuCodepointsNextLength(const AuROString &in)
{
if (in.length())
{
@ -452,7 +452,7 @@ static bool AuCodepointsForEach(T op, const AuROStrin
pItr += nby;
}
if constexpr (AuIsSame_v<AuResultOf_t<T, AuUInt32>, bool>)
if AUROXTL_CONSTEXPR_17 (AuIsSame_v<AuResultOf_t<T, AuUInt32>, bool>)
{
if (!op(c))
{
@ -841,8 +841,8 @@ static bool AuCodepointsEndsWithEqualIgnoreCase(const
}
/// Returns the byte offset of the codepoint index or AuROString::npos
static auline constexpr CodepointByteOffset_t AuCodepointsGetByteOffset(const AuROString &in,
CodepointOffset_t uCodepointIndex)
static auline AUROXTL_CONSTEXPR_17 CodepointByteOffset_t AuCodepointsGetByteOffset(const AuROString &in,
CodepointOffset_t uCodepointIndex)
{
AuUInt uCounter {};
auto uLength = in.length();
@ -931,7 +931,7 @@ static auline constexpr CodepointByteOffset_t AuCodepointsGetByteOffset(const Au
}
/// Returns the length of the codepoint index in bytes or AuROString::npos
static auline constexpr CodepointByteOffset_t AuCodepointsGetByteLength(const AuROString &in,
static auline AUROXTL_CONSTEXPR_17 CodepointByteOffset_t AuCodepointsGetByteLength(const AuROString &in,
CodepointOffset_t uCodepointIndex)
{
AuUInt uCounter {};
@ -1131,9 +1131,9 @@ static CodepointByteOffset_t AuCodepointsFindByteOffset(const AuROStri
/// AuCodepointsFindByteOffset same as above (AuCodepointsFindByteOffset), slightly less dumb, but still too bloated.
/// The main difference is that uStartPosition is trusted to be a valid start offset.
/// Worst thing about this is, assuming a valid string view, we don't need to worry about testing the validity of the previous bytes (<uStartPosition), or even the current codepoint byte offset (uStartPosition).
static constexpr CodepointByteOffset_t AuCodepointsFindByteOffsetUnsafe(const AuROString &in,
const AuROString &find,
CodepointByteOffset_t uStartPosition)
static AUROXTL_CONSTEXPR_17 CodepointByteOffset_t AuCodepointsFindByteOffsetUnsafe(const AuROString &in,
const AuROString &find,
CodepointByteOffset_t uStartPosition)
{
AuUInt uCounter = 0;
auto uLength = in.length();
@ -1233,8 +1233,8 @@ static constexpr CodepointByteOffset_t AuCodepointsFindByteOffsetUnsafe(const Au
/// An inefficient seek backwards to byte offset given an arbitrary codepoint offset.
/// Returns byte offset for codepoint offset - 1 or AuROString::npos
static constexpr CodepointByteOffset_t AuCodepointsFindPreviousValidByteOffsetFromOffset(const AuROString &in,
CodepointOffset_t uStartPosition)
static AUROXTL_CONSTEXPR_17 CodepointByteOffset_t AuCodepointsFindPreviousValidByteOffsetFromOffset(const AuROString &in,
CodepointOffset_t uStartPosition)
{
AuUInt uCounter = 0;
auto uLength = in.length();
@ -1331,8 +1331,8 @@ static constexpr CodepointByteOffset_t AuCodepointsFindPreviousValidByteOffsetFr
/// An efficient seek backwards to byte offset given an arbitrary codepoint byte offset.
/// Returns byte offset for codepoint byte offset - 1 or AuROString::npos
static constexpr CodepointByteOffset_t AuCodepointsFindPreviousValidByteOffsetFromByteOffset(const AuROString &in,
CodepointByteOffset_t uStartPosition)
static AUROXTL_CONSTEXPR_17 CodepointByteOffset_t AuCodepointsFindPreviousValidByteOffsetFromByteOffset(const AuROString &in,
CodepointByteOffset_t uStartPosition)
{
const char * pStart = in.data();
const char * pItr = pStart + uStartPosition - 1;
@ -1368,7 +1368,7 @@ static constexpr CodepointByteOffset_t AuCodepointsFindPreviousValidByteOffsetFr
}
}
static constexpr CodepointOffset_t AuCodepointsFindCodepointOffset(const AuROString &in,
static AUROXTL_CONSTEXPR_17 CodepointOffset_t AuCodepointsFindCodepointOffset(const AuROString &in,
CodepointByteOffset_t uBytePosition)
{
return AuCodepointsCount(in.substr(0, uBytePosition));
@ -1476,7 +1476,7 @@ static CodepointOffset_t AuCodepointsFindCodepointOffset(const AuR
}
/// For a given valid UTF8 string view, provides the delta byte offset or AuROString::npos, to delete the last most codepoint
static constexpr AuUInt AuCodepointsReverseIterate(const AuROString &string)
static AUROXTL_CONSTEXPR_17 AuUInt AuCodepointsReverseIterate(const AuROString &string)
{
auto uLastValid = AuCodepointsFindPreviousValidByteOffsetFromByteOffset(string, string.Size());
if (uLastValid == AuROString::npos)
@ -1488,7 +1488,7 @@ static constexpr AuUInt AuCodepointsReverseIterate(const AuROStri
}
/// For a given valid UTF8 string view, to delete the last most codepoint, this provides a view with the suffix removed or an empty view.
static constexpr AuROString AuCodepointsReverseIterateSubStrPrefixView(const AuROString &string)
static AUROXTL_CONSTEXPR_17 AuROString AuCodepointsReverseIterateSubStrPrefixView(const AuROString &string)
{
auto uOffset = AuCodepointsReverseIterate(string);
if (uOffset == AuROString::npos)
@ -1500,7 +1500,7 @@ static constexpr AuROString AuCodepointsReverseIterateSubStrPrefixVie
}
/// For a given valid UTF8 string view, to delete the last most codepoint, this provides a view with the just suffix to be removed or an empty view.
static constexpr AuROString AuCodepointsReverseIterateSubStrSuffixView(const AuROString &string)
static AUROXTL_CONSTEXPR_17 AuROString AuCodepointsReverseIterateSubStrSuffixView(const AuROString &string)
{
auto uLastValid = AuCodepointsFindPreviousValidByteOffsetFromByteOffset(string, string.Size());
if (uLastValid == AuROString::npos)
@ -1518,7 +1518,11 @@ static AuString & AuCodepointsReplaceAll(AuString &str,
AuUInt uStartPosition {};
while ((uStartPosition = AuCodepointsFindByteOffsetUnsafe(str, from, uStartPosition)) != AuROString::npos)
{
#if defined(AU_LANG_CPP_17_)
str.replace(uStartPosition, from.length(), to);
#else
str.replace(uStartPosition, from.length(), std::string(to).c_str(), 0, to.length());
#endif
uStartPosition += to.length();
}
return str;

View File

@ -11,7 +11,10 @@
/* read-only, null terminated, utf-8 *byte* view */
struct AuRONString
{
#if defined(AU_LANG_CPP_17_)
using traits_type = typename AuROString::traits_type;
#endif
using value_type = typename AuROString::value_type;
using pointer = typename AuROString::pointer;
using const_pointer = typename AuROString::const_pointer;
@ -25,7 +28,12 @@ struct AuRONString
using difference_type = typename AuROString::difference_type;
// using basic_string_view = AuROString;
#if defined(AU_LANG_CPP_17_)
using basic_string_view = std::basic_string_view<char>;
#else
using basic_string_view = AuROString;
#endif
cstatic constexpr size_type npos = size_type(-1);
@ -48,47 +56,47 @@ struct AuRONString
}
inline constexpr const_iterator begin() const noexcept
inline AUROXTL_CONSTEXPR_17 const_iterator begin() const noexcept
{
return this->cbegin();
}
inline constexpr const_iterator cbegin() const noexcept
inline AUROXTL_CONSTEXPR_17 const_iterator cbegin() const noexcept
{
return this->view.cbegin();
}
inline constexpr const_iterator end() const noexcept
inline AUROXTL_CONSTEXPR_17 const_iterator end() const noexcept
{
return this->cend();
}
inline constexpr const_iterator cend() const noexcept
inline AUROXTL_CONSTEXPR_17 const_iterator cend() const noexcept
{
return this->cbegin() + this->length();
}
inline constexpr const_reverse_iterator rbegin() const noexcept
inline AUROXTL_CONSTEXPR_17 const_reverse_iterator rbegin() const noexcept
{
return this->crbegin();
}
inline constexpr const_reverse_iterator crbegin() const noexcept
inline AUROXTL_CONSTEXPR_17 const_reverse_iterator crbegin() const noexcept
{
return const_reverse_iterator(this->cend());
}
inline constexpr const_reverse_iterator rend() const noexcept
inline AUROXTL_CONSTEXPR_17 const_reverse_iterator rend() const noexcept
{
return this->crend();
}
inline constexpr const_reverse_iterator crend() const noexcept
inline AUROXTL_CONSTEXPR_17 const_reverse_iterator crend() const noexcept
{
return const_reverse_iterator(this->cbegin());
}
inline constexpr int compare(AuROString v) const noexcept
inline AUROXTL_CONSTEXPR_17 int compare(AuROString v) const noexcept
{
if (size() < v.size())
{
@ -106,66 +114,66 @@ struct AuRONString
return iRet;
}
inline constexpr int compare(size_type pos1, size_type count1,
AuROString v) const
inline AUROXTL_CONSTEXPR_17 int compare(size_type pos1, size_type count1,
AuROString v) const
{
return this->view.substr(pos1, count1).compare(v);
}
inline constexpr int compare(size_type pos1, size_type count1, AuROString v,
size_type pos2, size_type count2) const
inline AUROXTL_CONSTEXPR_17 int compare(size_type pos1, size_type count1, AuROString v,
size_type pos2, size_type count2) const
{
return this->view.substr(pos1, count1).compare(v.substr(pos2, count2));
}
inline constexpr int compare(const char *s) const
inline AUROXTL_CONSTEXPR_17 int compare(const char *s) const
{
return this->compare(AuROString(s));
}
inline constexpr int compare(size_type pos1, size_type count1,
const char *s) const
inline AUROXTL_CONSTEXPR_17 int compare(size_type pos1, size_type count1,
const char *s) const
{
return this->view.substr(pos1, count1).compare(AuROString(s));
}
inline constexpr int compare(size_type pos1, size_type count1,
const char *s, size_type count2) const
inline AUROXTL_CONSTEXPR_17 int compare(size_type pos1, size_type count1,
const char *s, size_type count2) const
{
return this->view.substr(pos1, count1).compare(AuROString(s, count2));
}
inline constexpr bool starts_with(AuROString sv) const noexcept
inline AUROXTL_CONSTEXPR_17 bool starts_with(AuROString sv) const noexcept
{
return AuStartsWith(*this, sv);
}
inline constexpr bool starts_with(char ch) const noexcept
inline AUROXTL_CONSTEXPR_17 bool starts_with(char ch) const noexcept
{
return AuStartsWith(*this, AuROString(&ch, 1));
}
inline constexpr bool starts_with(const char *s) const
inline AUROXTL_CONSTEXPR_17 bool starts_with(const char *s) const
{
return AuStartsWith(*this, s);
}
inline constexpr bool ends_with(AuROString sv) const noexcept
inline AUROXTL_CONSTEXPR_17 bool ends_with(AuROString sv) const noexcept
{
return AuEndsWith(*this, sv);
}
inline constexpr bool ends_with(char ch) const noexcept
inline AUROXTL_CONSTEXPR_17 bool ends_with(char ch) const noexcept
{
return AuEndsWith(*this, AuROString(&ch, 1));
}
inline constexpr bool ends_with(const char *s) const
inline AUROXTL_CONSTEXPR_17 bool ends_with(const char *s) const
{
return AuEndsWith(*this, s);
}
inline constexpr bool contains(AuROString sv) const noexcept
inline AUROXTL_CONSTEXPR_17 bool contains(AuROString sv) const noexcept
{
#if 0
return AuCodepointsContains(*this, sv);
@ -174,67 +182,67 @@ struct AuRONString
#endif
}
inline constexpr bool contains(char c) const noexcept
inline AUROXTL_CONSTEXPR_17 bool contains(char c) const noexcept
{
return this->contains(AuROString(&c, 1));
}
inline constexpr bool contains(const char *s) const
inline AUROXTL_CONSTEXPR_17 bool contains(const char *s) const
{
return this->contains(AuROString(s));
}
inline constexpr const_reference operator[](size_type pos) const
inline AUROXTL_CONSTEXPR_17 const_reference operator[](size_type pos) const
{
return *(this->begin() + pos);
}
inline constexpr const_reference at(size_type pos) const
inline AUROXTL_CONSTEXPR_17 const_reference at(size_type pos) const
{
return this->view.at(pos);
}
inline constexpr const_reference front() const
inline AUROXTL_CONSTEXPR_17 const_reference front() const
{
return this->operator[](0);
}
inline constexpr const_reference back() const
inline AUROXTL_CONSTEXPR_17 const_reference back() const
{
return this->operator[](size() - 1);
}
inline constexpr const_pointer data() const noexcept
inline AUROXTL_CONSTEXPR_17 const_pointer data() const noexcept
{
return &this->operator[](0);
}
inline constexpr const_pointer c_str() const noexcept
inline AUROXTL_CONSTEXPR_17 const_pointer c_str() const noexcept
{
return this->data();
}
inline constexpr size_type max_size() const noexcept
inline AUROXTL_CONSTEXPR_17 size_type max_size() const noexcept
{
return this->view.max_size();
}
inline constexpr size_type size() const noexcept
inline AUROXTL_CONSTEXPR_17 size_type size() const noexcept
{
return this->view.size();
}
inline constexpr size_type length() const noexcept
inline AUROXTL_CONSTEXPR_17 size_type length() const noexcept
{
return this->size();
}
inline constexpr bool empty() const noexcept
inline AUROXTL_CONSTEXPR_17 bool empty() const noexcept
{
return this->size() == 0 || !this->view.data();
}
inline constexpr AuROString substr(size_type pos1, size_type count1 = npos) const noexcept
inline AUROXTL_CONSTEXPR_17 AuROString substr(size_type pos1, size_type count1 = npos) const noexcept
{
if (pos1 >= this->size())
{
@ -254,62 +262,62 @@ struct AuRONString
return AuROString { this->data() + pos1, count1 };
}
inline constexpr size_type find(AuROString v, size_type pos = 0) const noexcept
inline AUROXTL_CONSTEXPR_17 size_type find(AuROString v, size_type pos = 0) const noexcept
{
return AuCodepointsFindByteOffsetUnsafe(*this, v, pos);
}
inline constexpr size_type find(char ch, size_type pos = 0) const noexcept
inline AUROXTL_CONSTEXPR_17 size_type find(char ch, size_type pos = 0) const noexcept
{
return this->find(AuROString(&ch, 1), pos);
}
inline constexpr size_type find(const char *s, size_type pos, size_type count) const
inline AUROXTL_CONSTEXPR_17 size_type find(const char *s, size_type pos, size_type count) const
{
return this->find(AuROString(s, count), pos);
}
inline constexpr size_type find(const char *s, size_type pos = 0) const
inline AUROXTL_CONSTEXPR_17 size_type find(const char *s, size_type pos = 0) const
{
return this->find(AuROString(s), pos);
}
inline constexpr size_type rfind(AuROString v, size_type pos = npos) const noexcept
inline AUROXTL_CONSTEXPR_17 size_type rfind(AuROString v, size_type pos = npos) const noexcept
{
return this->view.rfind(v, pos);
}
inline constexpr size_type rfind(char ch, size_type pos = npos) const noexcept
inline AUROXTL_CONSTEXPR_17 size_type rfind(char ch, size_type pos = npos) const noexcept
{
return this->find(AuROString(&ch, 1), pos);
}
inline constexpr size_type rfind(const char *s, size_type pos, size_type count) const
inline AUROXTL_CONSTEXPR_17 size_type rfind(const char *s, size_type pos, size_type count) const
{
return this->rfind(AuROString(s, count), pos);
}
inline constexpr size_type rfind(const char *s, size_type pos = npos) const
inline AUROXTL_CONSTEXPR_17 size_type rfind(const char *s, size_type pos = npos) const
{
return this->rfind(AuROString(s), pos);
}
inline constexpr size_type find_first_not_of(AuROString right, const size_type offset = 0) const noexcept
inline AUROXTL_CONSTEXPR_17 size_type find_first_not_of(AuROString right, const size_type offset = 0) const noexcept
{
return this->view.find_first_not_of(right, offset);
}
inline constexpr size_type find_last_not_of(AuROString right, const size_type offset = npos) const noexcept
inline AUROXTL_CONSTEXPR_17 size_type find_last_not_of(AuROString right, const size_type offset = npos) const noexcept
{
return this->view.find_last_not_of(right, offset);
}
inline constexpr size_type find_last_of(AuROString right, const size_type offset = npos) const noexcept
inline AUROXTL_CONSTEXPR_17 size_type find_last_of(AuROString right, const size_type offset = npos) const noexcept
{
return this->view.find_last_of(right, offset);
}
inline constexpr size_type find_first_of(AuROString right, const size_type offset = 0) const noexcept
inline AUROXTL_CONSTEXPR_17 size_type find_first_of(AuROString right, const size_type offset = 0) const noexcept
{
if (right.size() == 0)
{
@ -319,67 +327,67 @@ struct AuRONString
return this->find(right, offset);
}
inline constexpr size_type find_first_of(const char c, const size_type offset = 0) const noexcept
inline AUROXTL_CONSTEXPR_17 size_type find_first_of(const char c, const size_type offset = 0) const noexcept
{
return this->find_first_of(AuROString(&c, 1), offset);
}
inline constexpr size_type find_first_of(const char *const s, const size_type offset, const size_type count) const
inline AUROXTL_CONSTEXPR_17 size_type find_first_of(const char *const s, const size_type offset, const size_type count) const
{
return this->find_first_of(AuROString(s, count), offset);
}
inline constexpr size_type find_first_of(const char *const s, const size_type offset = 0) const
inline AUROXTL_CONSTEXPR_17 size_type find_first_of(const char *const s, const size_type offset = 0) const
{
return this->find_first_of(AuROString(s), offset);
}
inline constexpr size_type find_last_of(const char c, const size_type offset = npos) const noexcept
inline AUROXTL_CONSTEXPR_17 size_type find_last_of(const char c, const size_type offset = npos) const noexcept
{
return this->find_last_of(AuROString(&c, 1), offset);
}
inline constexpr size_type find_last_of(const char *const s, const size_type offset, const size_type count) const
inline AUROXTL_CONSTEXPR_17 size_type find_last_of(const char *const s, const size_type offset, const size_type count) const
{
return this->find_last_of(AuROString(s, count), offset);
}
inline constexpr size_type find_last_of(const char *const s, const size_type offset = npos) const
inline AUROXTL_CONSTEXPR_17 size_type find_last_of(const char *const s, const size_type offset = npos) const
{
return this->find_last_of(AuROString(s), offset);
}
inline constexpr size_type find_first_not_of(const char c, const size_type offset = 0) const noexcept
inline AUROXTL_CONSTEXPR_17 size_type find_first_not_of(const char c, const size_type offset = 0) const noexcept
{
return this->find_first_not_of(AuROString(&c, 1), offset);
}
inline constexpr size_type find_first_not_of(const char *const s, const size_type offset, const size_type count) const
inline AUROXTL_CONSTEXPR_17 size_type find_first_not_of(const char *const s, const size_type offset, const size_type count) const
{
return this->find_first_not_of(AuROString(s, count), offset);
}
inline constexpr size_type find_first_not_of(const char *const s, const size_type offset = 0) const
inline AUROXTL_CONSTEXPR_17 size_type find_first_not_of(const char *const s, const size_type offset = 0) const
{
return this->find_first_not_of(AuROString(s), offset);
}
inline constexpr size_type find_last_not_of(const char c, const size_type offset = npos) const noexcept
inline AUROXTL_CONSTEXPR_17 size_type find_last_not_of(const char c, const size_type offset = npos) const noexcept
{
return this->find_last_not_of(AuROString(&c, 1), offset);
}
inline constexpr size_type find_last_not_of(const char *const s, const size_type offset, const size_type count) const
inline AUROXTL_CONSTEXPR_17 size_type find_last_not_of(const char *const s, const size_type offset, const size_type count) const
{
return this->find_last_not_of(AuROString(s, count), offset);
}
inline constexpr size_type find_last_not_of(const char *const s, const size_type offset = npos) const
inline AUROXTL_CONSTEXPR_17 size_type find_last_not_of(const char *const s, const size_type offset = npos) const
{
return this->find_last_not_of(AuROString(s), offset);
}
inline constexpr operator AuROString() const
inline AUROXTL_CONSTEXPR_17 operator AuROString() const
{
return this->view;
}
@ -389,301 +397,301 @@ struct AuRONString
return this->view;
}
inline constexpr const_iterator Begin() const noexcept
inline AUROXTL_CONSTEXPR_17 const_iterator Begin() const noexcept
{
return this->begin();
}
inline constexpr const_iterator CBegin() const noexcept
inline AUROXTL_CONSTEXPR_17 const_iterator CBegin() const noexcept
{
return this->cbegin();
}
inline constexpr const_iterator End() const noexcept
inline AUROXTL_CONSTEXPR_17 const_iterator End() const noexcept
{
return this->end();
}
inline constexpr const_iterator CEnd() const noexcept
inline AUROXTL_CONSTEXPR_17 const_iterator CEnd() const noexcept
{
return this->cend();
}
inline constexpr const_reverse_iterator RBegin() const noexcept
inline AUROXTL_CONSTEXPR_17 const_reverse_iterator RBegin() const noexcept
{
return this->rbegin();
}
inline constexpr const_reverse_iterator CRBegin() const noexcept
inline AUROXTL_CONSTEXPR_17 const_reverse_iterator CRBegin() const noexcept
{
return this->crbegin();
}
inline constexpr const_reverse_iterator REnd() const noexcept
inline AUROXTL_CONSTEXPR_17 const_reverse_iterator REnd() const noexcept
{
return this->rend();
}
inline constexpr const_reverse_iterator CREnd() const noexcept
inline AUROXTL_CONSTEXPR_17 const_reverse_iterator CREnd() const noexcept
{
return this->crend();
}
inline constexpr AuROString Substr(size_type pos1, size_type count1 = npos) const noexcept
inline AUROXTL_CONSTEXPR_17 AuROString Substr(size_type pos1, size_type count1 = npos) const noexcept
{
return this->substr(pos1, count1);
}
inline constexpr AuROString SubStr(size_type pos1, size_type count1 = npos) const noexcept
inline AUROXTL_CONSTEXPR_17 AuROString SubStr(size_type pos1, size_type count1 = npos) const noexcept
{
return this->substr(pos1, count1);
}
inline constexpr int Compare(AuROString v) const noexcept
inline AUROXTL_CONSTEXPR_17 int Compare(AuROString v) const noexcept
{
return this->compare(v);
}
inline constexpr int Compare(const AuROString &v) const noexcept
inline AUROXTL_CONSTEXPR_17 int Compare(const AuROString &v) const noexcept
{
return this->compare(v);
}
inline constexpr int Compare(size_type pos1, size_type count1,
inline AUROXTL_CONSTEXPR_17 int Compare(size_type pos1, size_type count1,
AuROString v) const
{
return this->compare(pos1, count1, v);
}
inline constexpr int Compare(size_type pos1, size_type count1, AuROString v,
size_type pos2, size_type count2) const
inline AUROXTL_CONSTEXPR_17 int Compare(size_type pos1, size_type count1, AuROString v,
size_type pos2, size_type count2) const
{
return this->compare(pos1, count1, v, pos2, count2);
}
inline constexpr int Compare(const char *s) const
inline AUROXTL_CONSTEXPR_17 int Compare(const char *s) const
{
return this->compare(s);
}
inline constexpr int Compare(size_type pos1, size_type count1,
inline AUROXTL_CONSTEXPR_17 int Compare(size_type pos1, size_type count1,
const char *s) const
{
return this->compare(pos1, count1, s);
}
inline constexpr int Compare(size_type pos1, size_type count1,
const char *s, size_type count2) const
inline AUROXTL_CONSTEXPR_17 int Compare(size_type pos1, size_type count1,
const char *s, size_type count2) const
{
return this->compare(pos1, count1, s, count2);
}
inline constexpr bool StartsWith(AuROString sv) const noexcept
inline AUROXTL_CONSTEXPR_17 bool StartsWith(AuROString sv) const noexcept
{
return this->starts_with(sv);
}
inline constexpr bool StartsWith(char ch) const noexcept
inline AUROXTL_CONSTEXPR_17 bool StartsWith(char ch) const noexcept
{
return this->starts_with(ch);
}
inline constexpr bool StartsWith(const char *s) const
inline AUROXTL_CONSTEXPR_17 bool StartsWith(const char *s) const
{
return this->starts_with(s);
}
inline constexpr bool EndsWith(AuROString sv) const noexcept
inline AUROXTL_CONSTEXPR_17 bool EndsWith(AuROString sv) const noexcept
{
return this->ends_with(sv);
}
inline constexpr bool EndsWith(char ch) const noexcept
inline AUROXTL_CONSTEXPR_17 bool EndsWith(char ch) const noexcept
{
return this->ends_with(ch);
}
inline constexpr bool EndsWith(const char *s) const
inline AUROXTL_CONSTEXPR_17 bool EndsWith(const char *s) const
{
return this->ends_with(s);
}
inline constexpr bool Contains(AuROString sv) const noexcept
inline AUROXTL_CONSTEXPR_17 bool Contains(AuROString sv) const noexcept
{
return this->contains(sv);
}
inline constexpr bool Contains(char C) const noexcept
inline AUROXTL_CONSTEXPR_17 bool Contains(char C) const noexcept
{
return this->contains(C);
}
inline constexpr bool Contains(const char *s) const
inline AUROXTL_CONSTEXPR_17 bool Contains(const char *s) const
{
return this->contains(s);
}
inline constexpr const_reference At(size_type pos) const
inline AUROXTL_CONSTEXPR_17 const_reference At(size_type pos) const
{
return this->at(pos);
}
inline constexpr const_reference Front() const
inline AUROXTL_CONSTEXPR_17 const_reference Front() const
{
return this->front();
}
inline constexpr const_reference Back() const
inline AUROXTL_CONSTEXPR_17 const_reference Back() const
{
return this->back();
}
inline constexpr const_pointer Data() const noexcept
inline AUROXTL_CONSTEXPR_17 const_pointer Data() const noexcept
{
return this->data();
}
inline constexpr const_pointer CStr() const noexcept
inline AUROXTL_CONSTEXPR_17 const_pointer CStr() const noexcept
{
return this->c_str();
}
inline constexpr size_type MaxSize() const noexcept
inline AUROXTL_CONSTEXPR_17 size_type MaxSize() const noexcept
{
return this->max_size();
}
inline constexpr size_type Size() const noexcept
inline AUROXTL_CONSTEXPR_17 size_type Size() const noexcept
{
return this->size();
}
inline constexpr size_type Length() const noexcept
inline AUROXTL_CONSTEXPR_17 size_type Length() const noexcept
{
return this->length();
}
inline constexpr bool Empty() const noexcept
inline AUROXTL_CONSTEXPR_17 bool Empty() const noexcept
{
return this->empty();
}
inline constexpr size_type Find(AuROString v, size_type pos = 0) const noexcept
inline AUROXTL_CONSTEXPR_17 size_type Find(AuROString v, size_type pos = 0) const noexcept
{
return this->find(v, pos);
}
inline constexpr size_type Find(char ch, size_type pos = 0) const noexcept
inline AUROXTL_CONSTEXPR_17 size_type Find(char ch, size_type pos = 0) const noexcept
{
return this->find(ch, pos);
}
inline constexpr size_type Find(const char *s, size_type pos, size_type count) const
inline AUROXTL_CONSTEXPR_17 size_type Find(const char *s, size_type pos, size_type count) const
{
return this->find(s, pos, count);
}
inline constexpr size_type Find(const char *s, size_type pos = 0) const
inline AUROXTL_CONSTEXPR_17 size_type Find(const char *s, size_type pos = 0) const
{
return this->find(s, pos);
}
inline constexpr size_type RFind(AuROString v, size_type pos = npos) const noexcept
inline AUROXTL_CONSTEXPR_17 size_type RFind(AuROString v, size_type pos = npos) const noexcept
{
return this->rfind(v, pos);
}
inline constexpr size_type RFind(char ch, size_type pos = npos) const noexcept
inline AUROXTL_CONSTEXPR_17 size_type RFind(char ch, size_type pos = npos) const noexcept
{
return this->rfind(ch, pos);
}
inline constexpr size_type Rfind(const char *s, size_type pos, size_type count) const
inline AUROXTL_CONSTEXPR_17 size_type Rfind(const char *s, size_type pos, size_type count) const
{
return this->rfind(s, pos, count);
}
inline constexpr size_type Rfind(const char *s, size_type pos = npos) const
inline AUROXTL_CONSTEXPR_17 size_type Rfind(const char *s, size_type pos = npos) const
{
return this->rfind(s, pos);
}
inline constexpr size_type FindFirstNotOf(const AuROString right, const size_type offset = 0) const noexcept
inline AUROXTL_CONSTEXPR_17 size_type FindFirstNotOf(const AuROString right, const size_type offset = 0) const noexcept
{
return this->find_first_not_of(right, offset);
}
inline constexpr size_type FindLastNotOf(const AuROString right, const size_type offset = npos) const noexcept
inline AUROXTL_CONSTEXPR_17 size_type FindLastNotOf(const AuROString right, const size_type offset = npos) const noexcept
{
return this->find_last_not_of(right, offset);
}
inline constexpr size_type FindLastOf(const AuROString right, const size_type offset = npos) const noexcept
inline AUROXTL_CONSTEXPR_17 size_type FindLastOf(const AuROString right, const size_type offset = npos) const noexcept
{
return this->find_last_of(right, offset);
}
inline constexpr size_type FindFirstOf(const AuROString right, const size_type offset = 0) const noexcept
inline AUROXTL_CONSTEXPR_17 size_type FindFirstOf(const AuROString right, const size_type offset = 0) const noexcept
{
return this->find_first_of(right, offset);
}
inline constexpr size_type Find_first_of(const char c, const size_type offset = 0) const noexcept
inline AUROXTL_CONSTEXPR_17 size_type Find_first_of(const char c, const size_type offset = 0) const noexcept
{
return this->find_first_of(c, offset);
}
inline constexpr size_type FindFirstOf(const char *const s, const size_type offset, const size_type count) const
inline AUROXTL_CONSTEXPR_17 size_type FindFirstOf(const char *const s, const size_type offset, const size_type count) const
{
return this->find_first_of(s, offset, count);
}
inline constexpr size_type FindFirstOf(const char *const s, const size_type offset = 0) const
inline AUROXTL_CONSTEXPR_17 size_type FindFirstOf(const char *const s, const size_type offset = 0) const
{
return this->find_first_of(s, offset);
}
inline constexpr size_type FindLastOf(const char c, const size_type offset = npos) const noexcept
inline AUROXTL_CONSTEXPR_17 size_type FindLastOf(const char c, const size_type offset = npos) const noexcept
{
return this->find_last_of(c, offset);
}
inline constexpr size_type FindLastOf(const char *const s, const size_type offset, const size_type count) const
inline AUROXTL_CONSTEXPR_17 size_type FindLastOf(const char *const s, const size_type offset, const size_type count) const
{
return this->find_last_of(s, offset, count);
}
inline constexpr size_type FindLastOf(const char *const s, const size_type offset = npos) const
inline AUROXTL_CONSTEXPR_17 size_type FindLastOf(const char *const s, const size_type offset = npos) const
{
return this->find_last_of(s, offset);
}
inline constexpr size_type FindFirstNotOf(const char c, const size_type offset = 0) const noexcept
inline AUROXTL_CONSTEXPR_17 size_type FindFirstNotOf(const char c, const size_type offset = 0) const noexcept
{
return this->find_first_not_of(c, offset);
}
inline constexpr size_type FindFirstNotOf(const char *const s, const size_type offset, const size_type count) const
inline AUROXTL_CONSTEXPR_17 size_type FindFirstNotOf(const char *const s, const size_type offset, const size_type count) const
{
return this->find_first_not_of(s, offset, count);
}
inline constexpr size_type FindFirstNotOf(const char *const s, const size_type offset = 0) const
inline AUROXTL_CONSTEXPR_17 size_type FindFirstNotOf(const char *const s, const size_type offset = 0) const
{
return this->find_first_not_of(s, offset);
}
inline constexpr size_type FindLastNotOf(const char c, const size_type offset = npos) const noexcept
inline AUROXTL_CONSTEXPR_17 size_type FindLastNotOf(const char c, const size_type offset = npos) const noexcept
{
return this->find_last_not_of(c, offset);
}
inline constexpr size_type FindLastNotOf(const char *const s, const size_type offset, const size_type count) const
inline AUROXTL_CONSTEXPR_17 size_type FindLastNotOf(const char *const s, const size_type offset, const size_type count) const
{
return this->find_last_not_of(s, offset, count);
}
inline constexpr size_type FindLastNotOf(const char *const s, const size_type offset = npos) const
inline AUROXTL_CONSTEXPR_17 size_type FindLastNotOf(const char *const s, const size_type offset = npos) const
{
return this->find_last_not_of(s, offset);
}

View File

@ -12,9 +12,11 @@
struct AuROString
{
// using basic_string_view = AuROString;
#if defined(AU_LANG_CPP_17_)
using basic_string_view = std::basic_string_view<char>;
using traits_type = typename basic_string_view::traits_type;
#endif
using value_type = char;
using pointer = char *;
@ -30,42 +32,53 @@ struct AuROString
cstatic constexpr size_type npos = size_type(-1);
inline constexpr AuROString()
inline AUROXTL_CONSTEXPR_17 AuROString()
{
}
AU_COPY_MOVE(AuROString);
inline constexpr AuROString(const AuString &str) :
#if !defined(AU_LANG_CPP_17_)
inline operator std::string() const
{
return std::string(this->begin(), this->end());
}
#endif
inline AU_CONSTEXPR_20 AuROString(const AuString &str) :
pPointer(str.data()),
uLength(str.length())
{
}
inline constexpr AuROString(const std::string &str) :
inline AU_CONSTEXPR_20 AuROString(const std::string &str) :
pPointer(str.data()),
uLength(str.length())
{
}
inline constexpr AuROString(const char *str) :
inline AU_CONSTEXPR_20 AuROString(const char *str) :
pPointer(str),
#if defined(AU_LANG_CPP_17_)
uLength(traits_type::length(str))
#else
uLength(strlen(str))
#endif
{
}
inline constexpr AuROString(const char *str,
inline AUROXTL_CONSTEXPR_17 AuROString(const char *str,
AuUInt uLength) :
pPointer(str),
uLength(uLength)
{
}
inline constexpr AuROString(const char *str,
inline AUROXTL_CONSTEXPR_17 AuROString(const char *str,
const char *strEnd) :
pPointer(str),
uLength(strEnd - str)
@ -73,54 +86,56 @@ struct AuROString
}
inline constexpr AuROString(basic_string_view strView) :
#if defined(AU_LANG_CPP_17_)
inline AUROXTL_CONSTEXPR_17 AuROString(basic_string_view strView) :
pPointer(strView.data()),
uLength(strView.size())
{
}
#endif
inline constexpr const_iterator begin() const noexcept
inline AUROXTL_CONSTEXPR_17 const_iterator begin() const noexcept
{
return this->cbegin();
}
inline constexpr const_iterator cbegin() const noexcept
inline AUROXTL_CONSTEXPR_17 const_iterator cbegin() const noexcept
{
return this->pPointer;
}
inline constexpr const_iterator end() const noexcept
inline AUROXTL_CONSTEXPR_17 const_iterator end() const noexcept
{
return this->cend();
}
inline constexpr const_iterator cend() const noexcept
inline AUROXTL_CONSTEXPR_17 const_iterator cend() const noexcept
{
return this->cbegin() + this->length();
}
inline constexpr const_reverse_iterator rbegin() const noexcept
inline AUROXTL_CONSTEXPR_17 const_reverse_iterator rbegin() const noexcept
{
return this->crbegin();
}
inline constexpr const_reverse_iterator crbegin() const noexcept
inline AUROXTL_CONSTEXPR_17 const_reverse_iterator crbegin() const noexcept
{
return const_reverse_iterator(this->cend());
}
inline constexpr const_reverse_iterator rend() const noexcept
inline AUROXTL_CONSTEXPR_17 const_reverse_iterator rend() const noexcept
{
return this->crend();
}
inline constexpr const_reverse_iterator crend() const noexcept
inline AUROXTL_CONSTEXPR_17 const_reverse_iterator crend() const noexcept
{
return const_reverse_iterator(this->cbegin());
}
inline constexpr AuROString substr(size_type pos1, size_type count1 = npos) const noexcept
inline AUROXTL_CONSTEXPR_17 AuROString substr(size_type pos1, size_type count1 = npos) const noexcept
{
if (pos1 >= this->uLength)
{
@ -140,7 +155,7 @@ struct AuROString
return AuROString { this->pPointer + pos1, count1 };
}
inline constexpr void stl_remove_suffix(size_type n)
inline AUROXTL_CONSTEXPR_17 void stl_remove_suffix(size_type n)
{
if (this->uLength < n)
{
@ -152,7 +167,7 @@ struct AuROString
}
}
inline constexpr void stl_remove_prefix(size_type n)
inline AUROXTL_CONSTEXPR_17 void stl_remove_prefix(size_type n)
{
if (this->uLength < n)
{
@ -164,7 +179,7 @@ struct AuROString
}
}
inline constexpr AuROString remove_suffix(size_type n) const
inline AUROXTL_CONSTEXPR_17 AuROString remove_suffix(size_type n) const
{
if (this->uLength < n)
{
@ -174,7 +189,7 @@ struct AuROString
return AuROString { this->pPointer, this->uLength - n };
}
inline constexpr AuROString remove_prefix(size_type n) const
inline AUROXTL_CONSTEXPR_17 AuROString remove_prefix(size_type n) const
{
if (this->uLength < n)
{
@ -184,17 +199,37 @@ struct AuROString
return AuROString { this->pPointer + n, this->uLength - n };
}
inline constexpr AuROString RemoveSuffix(size_type n) const
inline AUROXTL_CONSTEXPR_17 AuROString RemoveSuffix(size_type n) const
{
return remove_suffix(n);
}
inline constexpr AuROString RemovePrefix(size_type n) const
inline AUROXTL_CONSTEXPR_17 AuROString RemovePrefix(size_type n) const
{
return remove_prefix(n);
}
inline constexpr int compare(basic_string_view v) const noexcept
#if defined(AU_LANG_CPP_17_)
inline AUROXTL_CONSTEXPR_17 int compare(basic_string_view v) const noexcept
{
if (size() < v.size())
{
return -1;
}
int iRet = AuMemcmp(data(), v.data(), v.size());
if (size() > v.size() &&
iRet == 0)
{
return 1;
}
return iRet;
}
#endif
inline AUROXTL_CONSTEXPR_17 int compare(const AuROString &v) const noexcept
{
if (size() < v.size())
{
@ -212,84 +247,66 @@ struct AuROString
return iRet;
}
inline constexpr int compare(const AuROString &v) const noexcept
{
if (size() < v.size())
{
return -1;
}
int iRet = AuMemcmp(data(), v.data(), v.size());
if (size() > v.size() &&
iRet == 0)
{
return 1;
}
return iRet;
}
inline constexpr int compare(size_type pos1, size_type count1,
AuROString v) const
inline AUROXTL_CONSTEXPR_17 int compare(size_type pos1, size_type count1,
AuROString v) const
{
return this->substr(pos1, count1).compare(v);
}
inline constexpr int compare(size_type pos1, size_type count1, AuROString v,
size_type pos2, size_type count2) const
inline AUROXTL_CONSTEXPR_17 int compare(size_type pos1, size_type count1, AuROString v,
size_type pos2, size_type count2) const
{
return this->substr(pos1, count1).compare(v.substr(pos2, count2));
}
inline constexpr int compare(const char *s) const
inline AUROXTL_CONSTEXPR_17 int compare(const char *s) const
{
return this->compare(AuROString(s));
}
inline constexpr int compare(size_type pos1, size_type count1,
const char *s) const
inline AUROXTL_CONSTEXPR_17 int compare(size_type pos1, size_type count1,
const char *s) const
{
return this->substr(pos1, count1).compare(AuROString(s));
}
inline constexpr int compare(size_type pos1, size_type count1,
const char *s, size_type count2) const
inline AUROXTL_CONSTEXPR_17 int compare(size_type pos1, size_type count1,
const char *s, size_type count2) const
{
return this->substr(pos1, count1).compare(AuROString(s, count2));
}
inline constexpr bool starts_with(AuROString sv) const noexcept
inline AUROXTL_CONSTEXPR_17 bool starts_with(AuROString sv) const noexcept
{
return AuStartsWith(*this, sv);
}
inline constexpr bool starts_with(char ch) const noexcept
inline AUROXTL_CONSTEXPR_17 bool starts_with(char ch) const noexcept
{
return AuStartsWith(*this, AuROString(&ch, 1));
}
inline constexpr bool starts_with(const char *s) const
inline AUROXTL_CONSTEXPR_17 bool starts_with(const char *s) const
{
return AuStartsWith(*this, s);
}
inline constexpr bool ends_with(AuROString sv) const noexcept
inline AUROXTL_CONSTEXPR_17 bool ends_with(AuROString sv) const noexcept
{
return AuEndsWith(*this, sv);
}
inline constexpr bool ends_with(char ch) const noexcept
inline AUROXTL_CONSTEXPR_17 bool ends_with(char ch) const noexcept
{
return AuEndsWith(*this, AuROString(&ch, 1));
}
inline constexpr bool ends_with(const char *s) const
inline AUROXTL_CONSTEXPR_17 bool ends_with(const char *s) const
{
return AuEndsWith(*this, s);
}
inline constexpr bool contains(AuROString sv) const noexcept
inline AUROXTL_CONSTEXPR_17 bool contains(AuROString sv) const noexcept
{
#if 0
return AuCodepointsContains(*this, sv);
@ -298,118 +315,146 @@ struct AuROString
#endif
}
inline constexpr bool contains(char c) const noexcept
inline AUROXTL_CONSTEXPR_17 bool contains(char c) const noexcept
{
return this->contains(AuROString(&c, 1));
}
inline constexpr bool contains(const char *s) const
inline AUROXTL_CONSTEXPR_17 bool contains(const char *s) const
{
return this->contains(AuROString(s));
}
inline constexpr const_reference operator[](size_type pos) const
inline AUROXTL_CONSTEXPR_17 const_reference operator[](size_type pos) const
{
return *(this->begin() + pos);
}
inline constexpr const_reference at(size_type pos) const
inline AUROXTL_CONSTEXPR_17 const_reference at(size_type pos) const
{
return this->pPointer[pos];
}
inline constexpr const_reference front() const
inline AUROXTL_CONSTEXPR_17 const_reference front() const
{
return this->operator[](0);
}
inline constexpr const_reference back() const
inline AUROXTL_CONSTEXPR_17 const_reference back() const
{
return this->operator[](size() - 1);
}
inline constexpr const_pointer data() const noexcept
inline AUROXTL_CONSTEXPR_17 const_pointer data() const noexcept
{
return &this->operator[](0);
}
inline constexpr size_type max_size() const noexcept
inline AUROXTL_CONSTEXPR_17 size_type max_size() const noexcept
{
return SIZE_MAX;
//return AuNumericLimits<AuSInt>().max();
}
inline constexpr size_type size() const noexcept
inline AUROXTL_CONSTEXPR_17 size_type size() const noexcept
{
return this->uLength;
}
inline constexpr size_type length() const noexcept
inline AUROXTL_CONSTEXPR_17 size_type length() const noexcept
{
return this->size();
}
inline constexpr bool empty() const noexcept
inline AUROXTL_CONSTEXPR_17 bool empty() const noexcept
{
return this->size() == 0 || !this->pPointer;
}
inline constexpr size_type find(AuROString v, size_type pos = 0) const noexcept
inline AUROXTL_CONSTEXPR_17 size_type find(AuROString v, size_type pos = 0) const noexcept
{
return AuCodepointsFindByteOffsetUnsafe(*this, v, pos);
}
inline constexpr size_type find(char ch, size_type pos = 0) const noexcept
inline AUROXTL_CONSTEXPR_17 size_type find(char ch, size_type pos = 0) const noexcept
{
return this->find(AuROString(&ch, 1), pos);
}
inline constexpr size_type find(const char *s, size_type pos, size_type count) const
inline AUROXTL_CONSTEXPR_17 size_type find(const char *s, size_type pos, size_type count) const
{
return this->find(AuROString(s, count), pos);
}
inline constexpr size_type find(const char *s, size_type pos = 0) const
inline AUROXTL_CONSTEXPR_17 size_type find(const char *s, size_type pos = 0) const
{
return this->find(AuROString(s), pos);
}
inline constexpr size_type rfind(AuROString v, size_type pos = npos) const noexcept
#if defined(AU_LANG_CPP_17_)
inline AUROXTL_CONSTEXPR_17 size_type rfind(AuROString v, size_type pos = npos) const noexcept
{
return basic_string_view(*this).rfind(basic_string_view { v }, pos);
}
#else
size_type rfind(AuROString v, size_type pos = npos) const
{
return std::string(*this).rfind(std::string(v), pos);
}
#endif
inline constexpr size_type rfind(char ch, size_type pos = npos) const noexcept
inline AUROXTL_CONSTEXPR_17 size_type rfind(char ch, size_type pos = npos) const noexcept
{
return this->find(AuROString(&ch, 1), pos);
}
inline constexpr size_type rfind(const char *s, size_type pos, size_type count) const
inline AUROXTL_CONSTEXPR_17 size_type rfind(const char *s, size_type pos, size_type count) const
{
return this->rfind(AuROString(s, count), pos);
}
inline constexpr size_type rfind(const char *s, size_type pos = npos) const
inline AUROXTL_CONSTEXPR_17 size_type rfind(const char *s, size_type pos = npos) const
{
return this->rfind(AuROString(s), pos);
}
inline constexpr size_type find_first_not_of(const AuROString right, const size_type offset = 0) const noexcept
#if defined(AU_LANG_CPP_17_)
inline AUROXTL_CONSTEXPR_17 size_type find_first_not_of(const AuROString right, const size_type offset = 0) const noexcept
{
return basic_string_view(*this).find_first_not_of(basic_string_view { right }, offset);
}
inline constexpr size_type find_last_not_of(const AuROString right, const size_type offset = npos) const noexcept
inline AUROXTL_CONSTEXPR_17 size_type find_last_not_of(const AuROString right, const size_type offset = npos) const noexcept
{
return basic_string_view(*this).find_last_not_of(basic_string_view { right }, offset);
}
inline constexpr size_type find_last_of(const AuROString right, const size_type offset = npos) const noexcept
inline AUROXTL_CONSTEXPR_17 size_type find_last_of(const AuROString right, const size_type offset = npos) const noexcept
{
return basic_string_view(*this).find_last_of(basic_string_view { right }, offset);
}
inline constexpr size_type find_first_of(const AuROString right, const size_type offset = 0) const noexcept
#else
size_type find_first_not_of(const AuROString right, const size_type offset = 0) const
{
return std::string(*this).find_first_not_of(std::string(right), offset);
}
size_type find_last_not_of(const AuROString right, const size_type offset = npos) const
{
return std::string(*this).find_last_not_of(std::string(right), offset);
}
size_type find_last_of(const AuROString right, const size_type offset = npos) const
{
return std::string(*this).find_last_of(std::string(right), offset);
}
#endif
inline AUROXTL_CONSTEXPR_17 size_type find_first_of(const AuROString right, const size_type offset = 0) const noexcept
{
if (right.size() == 0)
{
@ -419,361 +464,365 @@ struct AuROString
return this->find(right, offset);
}
inline constexpr size_type find_first_of(const char c, const size_type offset = 0) const noexcept
inline AUROXTL_CONSTEXPR_17 size_type find_first_of(const char c, const size_type offset = 0) const noexcept
{
return this->find_first_of(AuROString(&c, 1), offset);
}
inline constexpr size_type find_first_of(const char *const s, const size_type offset, const size_type count) const
inline AUROXTL_CONSTEXPR_17 size_type find_first_of(const char *const s, const size_type offset, const size_type count) const
{
return this->find_first_of(AuROString(s, count), offset);
}
inline constexpr size_type find_first_of(const char *const s, const size_type offset = 0) const
inline AUROXTL_CONSTEXPR_17 size_type find_first_of(const char *const s, const size_type offset = 0) const
{
return this->find_first_of(AuROString(s), offset);
}
inline constexpr size_type find_last_of(const char c, const size_type offset = npos) const noexcept
inline AUROXTL_CONSTEXPR_17 size_type find_last_of(const char c, const size_type offset = npos) const noexcept
{
return this->find_last_of(AuROString(&c, 1), offset);
}
inline constexpr size_type find_last_of(const char *const s, const size_type offset, const size_type count) const
inline AUROXTL_CONSTEXPR_17 size_type find_last_of(const char *const s, const size_type offset, const size_type count) const
{
return this->find_last_of(AuROString(s, count), offset);
}
inline constexpr size_type find_last_of(const char *const s, const size_type offset = npos) const
inline AUROXTL_CONSTEXPR_17 size_type find_last_of(const char *const s, const size_type offset = npos) const
{
return this->find_last_of(AuROString(s), offset);
}
inline constexpr size_type find_first_not_of(const char c, const size_type offset = 0) const noexcept
inline AUROXTL_CONSTEXPR_17 size_type find_first_not_of(const char c, const size_type offset = 0) const noexcept
{
return this->find_first_not_of(AuROString(&c, 1), offset);
}
inline constexpr size_type find_first_not_of(const char *const s, const size_type offset, const size_type count) const
inline AUROXTL_CONSTEXPR_17 size_type find_first_not_of(const char *const s, const size_type offset, const size_type count) const
{
return this->find_first_not_of(AuROString(s, count), offset);
}
inline constexpr size_type find_first_not_of(const char *const s, const size_type offset = 0) const
inline AUROXTL_CONSTEXPR_17 size_type find_first_not_of(const char *const s, const size_type offset = 0) const
{
return this->find_first_not_of(AuROString(s), offset);
}
inline constexpr size_type find_last_not_of(const char c, const size_type offset = npos) const noexcept
inline AUROXTL_CONSTEXPR_17 size_type find_last_not_of(const char c, const size_type offset = npos) const noexcept
{
return this->find_last_not_of(AuROString(&c, 1), offset);
}
inline constexpr size_type find_last_not_of(const char *const s, const size_type offset, const size_type count) const
inline AUROXTL_CONSTEXPR_17 size_type find_last_not_of(const char *const s, const size_type offset, const size_type count) const
{
return this->find_last_not_of(AuROString(s, count), offset);
}
inline constexpr size_type find_last_not_of(const char *const s, const size_type offset = npos) const
inline AUROXTL_CONSTEXPR_17 size_type find_last_not_of(const char *const s, const size_type offset = npos) const
{
return this->find_last_not_of(AuROString(s), offset);
}
inline constexpr operator std::string_view() const
#if defined(AU_LANG_CPP_17_)
inline AUROXTL_CONSTEXPR_17 operator std::string_view() const
{
return std::string_view { pPointer, uLength };
}
#endif
inline constexpr const_iterator Begin() const noexcept
inline AUROXTL_CONSTEXPR_17 const_iterator Begin() const noexcept
{
return this->begin();
}
inline constexpr const_iterator CBegin() const noexcept
inline AUROXTL_CONSTEXPR_17 const_iterator CBegin() const noexcept
{
return this->cbegin();
}
inline constexpr const_iterator End() const noexcept
inline AUROXTL_CONSTEXPR_17 const_iterator End() const noexcept
{
return this->end();
}
inline constexpr const_iterator CEnd() const noexcept
inline AUROXTL_CONSTEXPR_17 const_iterator CEnd() const noexcept
{
return this->cend();
}
inline constexpr const_reverse_iterator RBegin() const noexcept
inline AUROXTL_CONSTEXPR_17 const_reverse_iterator RBegin() const noexcept
{
return this->rbegin();
}
inline constexpr const_reverse_iterator CRBegin() const noexcept
inline AUROXTL_CONSTEXPR_17 const_reverse_iterator CRBegin() const noexcept
{
return this->crbegin();
}
inline constexpr const_reverse_iterator REnd() const noexcept
inline AUROXTL_CONSTEXPR_17 const_reverse_iterator REnd() const noexcept
{
return this->rend();
}
inline constexpr const_reverse_iterator CREnd() const noexcept
inline AUROXTL_CONSTEXPR_17 const_reverse_iterator CREnd() const noexcept
{
return this->crend();
}
inline constexpr AuROString Substr(size_type pos1, size_type count1 = npos) const noexcept
inline AUROXTL_CONSTEXPR_17 AuROString Substr(size_type pos1, size_type count1 = npos) const noexcept
{
return this->substr(pos1, count1);
}
inline constexpr AuROString SubStr(size_type pos1, size_type count1 = npos) const noexcept
inline AUROXTL_CONSTEXPR_17 AuROString SubStr(size_type pos1, size_type count1 = npos) const noexcept
{
return this->substr(pos1, count1);
}
inline constexpr int Compare(basic_string_view v) const noexcept
#if defined(AU_LANG_CPP_17_)
inline AUROXTL_CONSTEXPR_17 int Compare(basic_string_view v) const noexcept
{
return this->compare(v);
}
#endif
inline AUROXTL_CONSTEXPR_17 int Compare(const AuROString &v) const noexcept
{
return this->compare(v);
}
inline constexpr int Compare(const AuROString &v) const noexcept
{
return this->compare(v);
}
inline constexpr int Compare(size_type pos1, size_type count1,
inline AUROXTL_CONSTEXPR_17 int Compare(size_type pos1, size_type count1,
AuROString v) const
{
return this->compare(pos1, count1, v);
}
inline constexpr int Compare(size_type pos1, size_type count1, AuROString v,
inline AUROXTL_CONSTEXPR_17 int Compare(size_type pos1, size_type count1, AuROString v,
size_type pos2, size_type count2) const
{
return this->compare(pos1, count1, v, pos2, count2);
}
inline constexpr int Compare(const char *s) const
inline AUROXTL_CONSTEXPR_17 int Compare(const char *s) const
{
return this->compare(s);
}
inline constexpr int Compare(size_type pos1, size_type count1,
inline AUROXTL_CONSTEXPR_17 int Compare(size_type pos1, size_type count1,
const char *s) const
{
return this->compare(pos1, count1, s);
}
inline constexpr int Compare(size_type pos1, size_type count1,
inline AUROXTL_CONSTEXPR_17 int Compare(size_type pos1, size_type count1,
const char *s, size_type count2) const
{
return this->compare(pos1, count1, s, count2);
}
inline constexpr bool StartsWith(AuROString sv) const noexcept
inline AUROXTL_CONSTEXPR_17 bool StartsWith(AuROString sv) const noexcept
{
return this->starts_with(sv);
}
inline constexpr bool StartsWith(char ch) const noexcept
inline AUROXTL_CONSTEXPR_17 bool StartsWith(char ch) const noexcept
{
return this->starts_with(ch);
}
inline constexpr bool StartsWith(const char *s) const
inline AUROXTL_CONSTEXPR_17 bool StartsWith(const char *s) const
{
return this->starts_with(s);
}
inline constexpr bool EndsWith(AuROString sv) const noexcept
inline AUROXTL_CONSTEXPR_17 bool EndsWith(AuROString sv) const noexcept
{
return this->ends_with(sv);
}
inline constexpr bool EndsWith(char ch) const noexcept
inline AUROXTL_CONSTEXPR_17 bool EndsWith(char ch) const noexcept
{
return this->ends_with(ch);
}
inline constexpr bool EndsWith(const char *s) const
inline AUROXTL_CONSTEXPR_17 bool EndsWith(const char *s) const
{
return this->ends_with(s);
}
inline constexpr bool Contains(AuROString sv) const noexcept
inline AUROXTL_CONSTEXPR_17 bool Contains(AuROString sv) const noexcept
{
return this->contains(sv);
}
inline constexpr bool Contains(char C) const noexcept
inline AUROXTL_CONSTEXPR_17 bool Contains(char C) const noexcept
{
return this->contains(C);
}
inline constexpr bool Contains(const char *s) const
inline AUROXTL_CONSTEXPR_17 bool Contains(const char *s) const
{
return this->contains(s);
}
inline constexpr const_reference At(size_type pos) const
inline AUROXTL_CONSTEXPR_17 const_reference At(size_type pos) const
{
return this->at(pos);
}
inline constexpr const_reference Front() const
inline AUROXTL_CONSTEXPR_17 const_reference Front() const
{
return this->front();
}
inline constexpr const_reference Back() const
inline AUROXTL_CONSTEXPR_17 const_reference Back() const
{
return this->back();
}
inline constexpr const_pointer Data() const noexcept
inline AUROXTL_CONSTEXPR_17 const_pointer Data() const noexcept
{
return this->data();
}
inline constexpr size_type MaxSize() const noexcept
inline AUROXTL_CONSTEXPR_17 size_type MaxSize() const noexcept
{
return this->max_size();
}
inline constexpr size_type Size() const noexcept
inline AUROXTL_CONSTEXPR_17 size_type Size() const noexcept
{
return this->size();
}
inline constexpr size_type Length() const noexcept
inline AUROXTL_CONSTEXPR_17 size_type Length() const noexcept
{
return this->length();
}
inline constexpr bool Empty() const noexcept
inline AUROXTL_CONSTEXPR_17 bool Empty() const noexcept
{
return this->empty();
}
inline constexpr size_type Find(AuROString v, size_type pos = 0) const noexcept
inline AUROXTL_CONSTEXPR_17 size_type Find(AuROString v, size_type pos = 0) const noexcept
{
return this->find(v, pos);
}
inline constexpr size_type Find(char ch, size_type pos = 0) const noexcept
inline AUROXTL_CONSTEXPR_17 size_type Find(char ch, size_type pos = 0) const noexcept
{
return this->find(ch, pos);
}
inline constexpr size_type Find(const char *s, size_type pos, size_type count) const
inline AUROXTL_CONSTEXPR_17 size_type Find(const char *s, size_type pos, size_type count) const
{
return this->find(s, pos, count);
}
inline constexpr size_type Find(const char *s, size_type pos = 0) const
inline AUROXTL_CONSTEXPR_17 size_type Find(const char *s, size_type pos = 0) const
{
return this->find(s, pos);
}
inline constexpr size_type RFind(AuROString v, size_type pos = npos) const noexcept
inline AUROXTL_CONSTEXPR_17 size_type RFind(AuROString v, size_type pos = npos) const noexcept
{
return this->rfind(v, pos);
}
inline constexpr size_type RFind(char ch, size_type pos = npos) const noexcept
inline AUROXTL_CONSTEXPR_17 size_type RFind(char ch, size_type pos = npos) const noexcept
{
return this->rfind(ch, pos);
}
inline constexpr size_type Rfind(const char *s, size_type pos, size_type count) const
inline AUROXTL_CONSTEXPR_17 size_type Rfind(const char *s, size_type pos, size_type count) const
{
return this->rfind(s, pos, count);
}
inline constexpr size_type Rfind(const char *s, size_type pos = npos) const
inline AUROXTL_CONSTEXPR_17 size_type Rfind(const char *s, size_type pos = npos) const
{
return this->rfind(s, pos);
}
inline constexpr size_type FindFirstNotOf(const AuROString right, const size_type offset = 0) const noexcept
inline AUROXTL_CONSTEXPR_17 size_type FindFirstNotOf(const AuROString right, const size_type offset = 0) const noexcept
{
return this->find_first_not_of(right, offset);
}
inline constexpr size_type FindLastNotOf(const AuROString right, const size_type offset = npos) const noexcept
inline AUROXTL_CONSTEXPR_17 size_type FindLastNotOf(const AuROString right, const size_type offset = npos) const noexcept
{
return this->find_last_not_of(right, offset);
}
inline constexpr size_type FindLastOf(const AuROString right, const size_type offset = npos) const noexcept
inline AUROXTL_CONSTEXPR_17 size_type FindLastOf(const AuROString right, const size_type offset = npos) const noexcept
{
return this->find_last_of(right, offset);
}
inline constexpr size_type FindFirstOf(const AuROString right, const size_type offset = 0) const noexcept
inline AUROXTL_CONSTEXPR_17 size_type FindFirstOf(const AuROString right, const size_type offset = 0) const noexcept
{
return this->find_first_of(right, offset);
}
inline constexpr size_type Find_first_of(const char c, const size_type offset = 0) const noexcept
inline AUROXTL_CONSTEXPR_17 size_type Find_first_of(const char c, const size_type offset = 0) const noexcept
{
return this->find_first_of(c, offset);
}
inline constexpr size_type FindFirstOf(const char *const s, const size_type offset, const size_type count) const
inline AUROXTL_CONSTEXPR_17 size_type FindFirstOf(const char *const s, const size_type offset, const size_type count) const
{
return this->find_first_of(s, offset, count);
}
inline constexpr size_type FindFirstOf(const char *const s, const size_type offset = 0) const
inline AUROXTL_CONSTEXPR_17 size_type FindFirstOf(const char *const s, const size_type offset = 0) const
{
return this->find_first_of(s, offset);
}
inline constexpr size_type FindLastOf(const char c, const size_type offset = npos) const noexcept
inline AUROXTL_CONSTEXPR_17 size_type FindLastOf(const char c, const size_type offset = npos) const noexcept
{
return this->find_last_of(c, offset);
}
inline constexpr size_type FindLastOf(const char *const s, const size_type offset, const size_type count) const
inline AUROXTL_CONSTEXPR_17 size_type FindLastOf(const char *const s, const size_type offset, const size_type count) const
{
return this->find_last_of(s, offset, count);
}
inline constexpr size_type FindLastOf(const char *const s, const size_type offset = npos) const
inline AUROXTL_CONSTEXPR_17 size_type FindLastOf(const char *const s, const size_type offset = npos) const
{
return this->find_last_of(s, offset);
}
inline constexpr size_type FindFirstNotOf(const char c, const size_type offset = 0) const noexcept
inline AUROXTL_CONSTEXPR_17 size_type FindFirstNotOf(const char c, const size_type offset = 0) const noexcept
{
return this->find_first_not_of(c, offset);
}
inline constexpr size_type FindFirstNotOf(const char *const s, const size_type offset, const size_type count) const
inline AUROXTL_CONSTEXPR_17 size_type FindFirstNotOf(const char *const s, const size_type offset, const size_type count) const
{
return this->find_first_not_of(s, offset, count);
}
inline constexpr size_type FindFirstNotOf(const char *const s, const size_type offset = 0) const
inline AUROXTL_CONSTEXPR_17 size_type FindFirstNotOf(const char *const s, const size_type offset = 0) const
{
return this->find_first_not_of(s, offset);
}
inline constexpr size_type FindLastNotOf(const char c, const size_type offset = npos) const noexcept
inline AUROXTL_CONSTEXPR_17 size_type FindLastNotOf(const char c, const size_type offset = npos) const noexcept
{
return this->find_last_not_of(c, offset);
}
inline constexpr size_type FindLastNotOf(const char *const s, const size_type offset, const size_type count) const
inline AUROXTL_CONSTEXPR_17 size_type FindLastNotOf(const char *const s, const size_type offset, const size_type count) const
{
return this->find_last_not_of(s, offset, count);
}
inline constexpr size_type FindLastNotOf(const char *const s, const size_type offset = npos) const
inline AUROXTL_CONSTEXPR_17 size_type FindLastNotOf(const char *const s, const size_type offset = npos) const
{
return this->find_last_not_of(s, offset);
}

View File

@ -20,27 +20,27 @@ static AuString AuCodepointsToLower(const AuROString &in);
/// No localization complexities are, will, or should be involved.
static AuString AuCodepointsToUpper(const AuROString &in);
static auline constexpr bool AuIsAlpha(char c)
static auline AU_CONSTEXPR_17 bool AuIsAlpha(char c)
{
return (c) && (((unsigned char)c | 0x20) - 'a' < 26);
}
static auline constexpr char AuToLower(char c)
static auline AU_CONSTEXPR_17 char AuToLower(char c)
{
return AuIsAlpha(c) ? c | 0x20 : c;
}
static auline constexpr char AuToUpper(char c)
static auline AU_CONSTEXPR_17 char AuToUpper(char c)
{
return AuIsAlpha(c) ? c & ~0x20 : c;
}
static auline constexpr bool AuStringContains(const AuROString &value, const AuROString &subpattern)
static auline AU_CONSTEXPR_17 bool AuStringContains(const AuROString &value, const AuROString &subpattern)
{
return value.find(subpattern) != AuROString::npos;
}
static auline constexpr bool AuEndsWith(AuROString const &value, AuROString const &ending)
static auline AU_CONSTEXPR_17 bool AuEndsWith(AuROString const &value, AuROString const &ending)
{
if (ending.size() > value.size())
{
@ -52,10 +52,12 @@ static auline constexpr bool AuEndsWith(AuROString const &value, AuROString cons
}
}
static auline constexpr bool AuStartsWith(AuROString const &value, AuROString const &starting)
static auline AU_CONSTEXPR_17 bool AuStartsWith(AuROString const &value, AuROString const &starting)
{
#if defined(AU_STRING_IS_TINYUTF_EXPERIMENT)
return value.starts_with(starting);
#elif !defined(AU_LANG_CPP_17_)
return std::string(value).rfind(std::string(starting), 0) == 0;
#else
return value.rfind(starting, 0) == 0;
#endif
@ -80,7 +82,11 @@ static AuString &AuReplaceAll(AuString &str,
AuUInt uStartPosition {};
while ((uStartPosition = str.find(from, uStartPosition)) != AuROString::npos)
{
#if defined(AU_LANG_CPP_17_)
str.replace(uStartPosition, from.length(), to);
#else
str.replace(uStartPosition, from.length(), std::string(to).c_str(), 0, to.size());
#endif
uStartPosition += to.length();
}
return str;
@ -129,7 +135,7 @@ static AuList<AuString> AuSplitStringLegacy(const AuROString &str,
auto token = str.substr(prev, pos - prev);
if ((!token.empty()) && bIgnoreEmpty)
{
tokens.push_back(AuString(token));
tokens.push_back(AuString(token.begin(), token.end()));
}
prev = pos + delim.length();
}

View File

@ -62,26 +62,26 @@ struct AuArray
if constexpr (AuIsTriviallyCopyable_v<T>)
{
AuMemcpy(temp, this->elements, sizeof(this->elements));
AuMemcpy(temp.elements, this->elements, sizeof(this->elements));
AuMemcpy(this->elements, other.elements, sizeof(this->elements));
AuMemcpy(other.elements, temp, sizeof(this->elements));
AuMemcpy(other.elements, temp.elements, sizeof(this->elements));
}
else
{
AuArray temp;
for (AU_ITERATE_N(i, kElementCount))
{
temp[i] = this->elements[i];
temp[i] = AuMove(this->elements[i]);
}
for (AU_ITERATE_N(i, kElementCount))
{
this->elements[i] = other.elements[i];
this->elements[i] = AuMove(other.elements[i]);
}
for (AU_ITERATE_N(i, kElementCount))
{
other.elements[i] = temp[i];
other.elements[i] = AuMove(temp[i]);
}
}
}
@ -387,6 +387,36 @@ struct AuArray
}
};
template <class T, AuUInt N>
bool operator==(const AuArray<T, N> &lhs,
const AuArray<T, N> &rhs)
{
for (AU_ITERATE_N(i, N))
{
if (lhs[i] != rhs[i])
{
return false;
}
}
return true;
}
template <class T, AuUInt N>
bool operator!=(const AuArray<T, N> &lhs,
const AuArray<T, N> &rhs)
{
for (AU_ITERATE_N(i, N))
{
if (lhs[i] != rhs[i])
{
return true;
}
}
return false;
}
#else
#if !defined(AURORA_RUNTIME_AU_ARRAY)
#define AURORA_RUNTIME_AU_ARRAY std::array

View File

@ -28,4 +28,4 @@ struct AuIsBST<AuBST<T, Z, A, B>> : AuTrueType
{ };
template <class T>
inline constexpr bool AuIsBST_v = AuIsBST<T>::type::value;
constexpr bool AuIsBST_v = AuIsBST<T>::type::value;

View File

@ -10,14 +10,14 @@
// options: _AU_FORCE_NO_FLIP8_MAP, _AU_DO_NOT_USE_BITFLIP_U16, _AU_DO_NOT_USE_BITFLIP_U32
namespace __audetail
{
inline const constexpr AuUInt8 kFlipBitsU4Lookup[16] {
AU_INLINE_17 const constexpr AuUInt8 kFlipBitsU4Lookup[16] {
0x0, 0x8, 0x4, 0xc, 0x2, 0xa, 0x6, 0xe,
0x1, 0x9, 0x5, 0xd, 0x3, 0xb, 0x7, 0xf
};
#if !defined(_AU_FORCE_NO_FLIP8_MAP)
#define _AU_HAS_FLIP8
inline const constexpr AuUInt8 kFlipBitsU8Lookup[256] {
AU_INLINE_17 const constexpr AuUInt8 kFlipBitsU8Lookup[256] {
0, 128, 64, 192, 32, 160, 96, 224,
16, 144, 80, 208, 48, 176, 112, 240,
8, 136, 72, 200, 40, 168, 104, 232,

View File

@ -89,16 +89,35 @@ inline bool AuTryRemoveRange(T &in, AuUInt index, AuUInt length)
template <class Map, class Key, class Value, AU_TEMPLATE_ENABLE_WHEN(__audetail::AuHasfind_v<Map> && !AuIsPointer_v<Map>)>
inline bool AuTryFind(Map &map, const Key &key, Value *&ptr)
{
auto itr = map.find(key);
if (itr != map.end())
ptr = nullptr;
if constexpr (AuIsSame_v<Key, AuROString> &&
Aurora::Build::kCurrentLanguage != Aurora::Build::ELanguage::eCpp20 &&
(int)Aurora::Build::kCurrentLanguage < 20)
{
ptr = &itr->second;
return true;
auto itr = map.find(AuString(key));
if (itr != map.end())
{
ptr = &itr->second;
return true;
}
else
{
return false;
}
}
else
{
ptr = nullptr;
return false;
auto itr = map.find(key);
if (itr != map.end())
{
ptr = &itr->second;
return true;
}
else
{
return false;
}
}
}
@ -549,10 +568,13 @@ inline bool AuTryInsert(Map *map, const Value &value)
return AuTryInsert(*map, value);
}
namespace Aurora::Memory
namespace Aurora
{
namespace Memory
{
struct ByteBuffer;
}
}
template <class T>
inline bool AuTryResize(T &list, AuUInt length)

View File

@ -28,4 +28,4 @@ struct AuIsHashMap<AuHashMap<T, Z, H, E, A>> : AuTrueType
{ };
template <class T>
inline constexpr bool AuIsHashMap_v = AuIsHashMap<T>::type::value;
constexpr bool AuIsHashMap_v = AuIsHashMap<T>::type::value;

View File

@ -21,6 +21,12 @@
#define _AH_HAS_RETARD_CONSTEXPR constexpr
#endif
#if defined(AU_LANG_CPP_17_)
#define std_string_view std::string_view
#else
#define std_string_view AuROString
#endif
template <class T>
struct AuHasHashCode
{
@ -30,7 +36,7 @@ struct AuHasHashCode
};
template <class T>
constexpr inline bool AuHasHashCode_v = AuHasHashCode<T>::type::value;
constexpr bool AuHasHashCode_v = AuHasHashCode<T>::type::value;
namespace AuHash
{
@ -208,7 +214,9 @@ namespace AuHash
_HASH_INT(char);
_HASH_INT(signed char);
_HASH_INT(unsigned char);
#if defined(AU_LANG_CPP_20_)
_HASH_INT(char8_t);
#endif
_HASH_INT(char16_t);
_HASH_INT(char32_t);
_HASH_INT(wchar_t);
@ -273,7 +281,7 @@ namespace AuHash
{
using is_transparent = void;
bool operator()(std::string_view lhs, std::string_view rhs) const
bool operator()(std_string_view lhs, std_string_view rhs) const
{
return lhs == rhs;
}
@ -284,7 +292,7 @@ namespace AuHash
{
using is_transparent = void;
bool operator()(std::string_view lhs, std::string_view rhs) const
bool operator()(std_string_view lhs, std_string_view rhs) const
{
return lhs == rhs;
}
@ -295,7 +303,7 @@ namespace AuHash
{
using is_transparent = void;
bool operator()(std::string_view lhs, std::string_view rhs) const
bool operator()(std_string_view lhs, std_string_view rhs) const
{
return lhs == rhs;
}
@ -306,7 +314,7 @@ namespace AuHash
{
using is_transparent = void;
bool operator()(std::string_view lhs, std::string_view rhs) const
bool operator()(std_string_view lhs, std_string_view rhs) const
{
return lhs == rhs;
}
@ -356,27 +364,15 @@ namespace AuHash
// container bug in msvc?
#if 0
template <>
struct hash<std::string_view>
struct hash<std_string_view>
{
size_t operator()(std::string_view txt) const
size_t operator()(std_string_view txt) const
{
return AuFnv1aRuntime(txt.data(), txt.size());
}
};
#endif
template <>
struct hash<std::string>
{
using is_transparent = void;
using transparent_key_equal = equal<std::string>;
size_t operator()(std::string_view txt) const
{
return hash<std::string_view>{}(txt);
}
};
template <>
struct hash<AuROString>
{
@ -385,10 +381,27 @@ namespace AuHash
size_t operator()(AuROString txt) const
{
#if defined(AU_LANG_CPP_17_)
return hash<std::string_view>{}(txt);
#else
return AuFnv1aRuntime(txt.data(), txt.size());
#endif
}
};
template <>
struct hash<std::string>
{
using is_transparent = void;
using transparent_key_equal = equal<std::string>;
size_t operator()(std_string_view txt) const
{
return hash<std_string_view>{}(txt);
}
};
template <>
struct hash<AuRONString>
{
@ -397,7 +410,7 @@ namespace AuHash
size_t operator()(AuROString txt) const
{
return hash<std::string_view>{}(txt);
return hash<std_string_view>{}(txt);
}
};
@ -407,9 +420,9 @@ namespace AuHash
using is_transparent = void;
using transparent_key_equal = equal<std::basic_string<char, std::char_traits<char>, Aurora::Memory::StringAllocator<char>>>;
size_t operator()(std::string_view txt) const
size_t operator()(std_string_view txt) const
{
return hash<std::string_view>{}(txt);
return hash<std_string_view>{}(txt);
}
};
@ -418,12 +431,12 @@ namespace AuHash
{
using is_transparent = void;
bool operator()(std::string_view lhs, std::string_view rhs) const
bool operator()(std_string_view lhs, std_string_view rhs) const
{
#if 0
return AuFnv1aRuntime(lhs.data(), lhs.size()) < AuFnv1aRuntime(rhs.data(), rhs.size());
#else
return hash<std::string_view>{}(lhs) < hash<std::string_view>{}(rhs);
return hash<std_string_view>{}(lhs) < hash<std_string_view>{}(rhs);
#endif
}
};
@ -433,28 +446,30 @@ namespace AuHash
{
using is_transparent = void;
bool operator()(std::string_view lhs, std::string_view rhs) const
bool operator()(std_string_view lhs, std_string_view rhs) const
{
#if 0
return AuFnv1aRuntime(lhs.data(), lhs.size()) < AuFnv1aRuntime(rhs.data(), rhs.size());
#else
return hash<std::string_view>{}(lhs) < hash<std::string_view>{}(rhs);
return hash<std_string_view>{}(lhs) < hash<std_string_view>{}(rhs);
#endif
}
};
template <>
struct less<std::string_view>
{
bool operator()(std::string_view lhs, std::string_view rhs) const
{
#if 0
return AuFnv1aRuntime(lhs.data(), lhs.size()) < AuFnv1aRuntime(rhs.data(), rhs.size());
#else
return hash<std::string_view>{}(lhs) < hash<std::string_view>{}(rhs);
#endif
}
};
//#if !defined(AU_LANG_CPP_17_)
// template <>
// struct less<std_string_view>
// {
// bool operator()(std_string_view lhs, std_string_view rhs) const
// {
// #if 0
// return AuFnv1aRuntime(lhs.data(), lhs.size()) < AuFnv1aRuntime(rhs.data(), rhs.size());
// #else
// return hash<std_string_view>{}(lhs) < hash<std_string_view>{}(rhs);
// #endif
// }
// };
//#endif
template <>
struct less<AuRONString>
@ -464,7 +479,7 @@ namespace AuHash
#if 0
return AuFnv1aRuntime(lhs.data(), lhs.size()) < AuFnv1aRuntime(rhs.data(), rhs.size());
#else
return hash<std::string_view>{}(AuROString(lhs)) < hash<std::string_view>{}(AuROString(lhs));
return hash<std_string_view>{}(AuROString(lhs)) < hash<std_string_view>{}(AuROString(lhs));
#endif
}
};
@ -477,7 +492,7 @@ namespace AuHash
#if 0
return AuFnv1aRuntime(lhs.data(), lhs.size()) < AuFnv1aRuntime(rhs.data(), rhs.size());
#else
return hash<std::string_view>{}(lhs) < hash<std::string_view>{}(rhs);
return hash<std_string_view>{}(lhs) < hash<std_string_view>{}(rhs);
#endif
}
};
@ -490,7 +505,7 @@ namespace AuHash
#if 0
return AuFnv1aRuntime(lhs, strlen(lhs)) < AuFnv1aRuntime(rhs, strlen(rhs));
#else
return hash<std::string_view>{}(lhs) < hash<std::string_view>{}(rhs);
return hash<std_string_view>{}(lhs) < hash<std_string_view>{}(rhs);
#endif
}
};

View File

@ -19,10 +19,13 @@ namespace __audetail
extern AuHeap *gDefaultDiscontiguousHeap;
}
namespace Aurora::Memory
namespace Aurora
{
namespace Memory
{
struct ProxyHeap;
}
}
#if !defined(AURORA_RUNTIME_AU_SHARED_PTR)
#define AURORA_RUNTIME_AU_SHARED_PTR std::shared_ptr
@ -118,7 +121,9 @@ static void auline AuSafeDelete(T *in)
template <class T>
struct AuPMRAllocator;
namespace Aurora::Memory
namespace Aurora
{
namespace Memory
{
template <class T>
struct CppHeapWrapper;
@ -309,6 +314,7 @@ namespace Aurora::Memory
#endif
}
}
#if defined(AURORA_ROXTL_ALLOCATORS_USE_STD)
@ -411,7 +417,7 @@ namespace __audetail
char a;
};
inline AuSPtr<Dummy> gDummy;
AU_INLINE_OR_STATIC_17 AuSPtr<Dummy> gDummy;
inline AuSPtr<Dummy> GetDummyDeleter()
{

View File

@ -18,4 +18,4 @@ template <class T>
using AuOptional = AURORA_RUNTIME_AU_OPTIONAL<T>;
template <class T>
constexpr inline bool AuIsOptional_v = __audetail::AuHashas_value_v<T>;
constexpr bool AuIsOptional_v = __audetail::AuHashas_value_v<T>;

View File

@ -25,10 +25,10 @@ namespace __audetail
};
template <class T>
constexpr inline bool AuAuHasSwap_v = AuHasSwap<T>::type::value;
constexpr bool AuAuHasSwap_v = AuHasSwap<T>::type::value;
template <class T>
constexpr inline bool AuAuHasswap_v = AuHasswap<T>::type::value;
constexpr bool AuAuHasswap_v = AuHasswap<T>::type::value;
}
template <class T, class U = T>

View File

@ -57,26 +57,26 @@ struct AuIsSame<T, T> : AuTrueType
{};
template <class T, class U>
inline AUROXTL_CONSTEXPR bool AuIsSame_v = AuIsSame<T, U>::value;
AUROXTL_CONSTEXPR_17 bool AuIsSame_v = AuIsSame<T, U>::value;
template <class>
inline AUROXTL_CONSTEXPR bool AuIsConst_v = false;
AUROXTL_CONSTEXPR_17 bool AuIsConst_v = false;
template <class T>
inline AUROXTL_CONSTEXPR bool AuIsConst_v<const T> = true;
AUROXTL_CONSTEXPR_17 bool AuIsConst_v<const T> = true;
namespace _audetail
{
template <class T>
AuBoolType<!__is_union(T)> IsClass(int T:: *);
AUROXTL_CONSTEXPR_14 AuBoolType<!__is_union(T)> IsClass(int T:: *);
template <class>
AuFalseType IsClass(...);
AUROXTL_CONSTEXPR_14 AuFalseType IsClass(...);
template <class B>
AuTrueType TestIsPtrConvertible(const volatile B *);
AUROXTL_CONSTEXPR_14 AuTrueType TestIsPtrConvertible(const volatile B *);
template <class>
AuFalseType TestIsPtrConvertible(const volatile void *);
AUROXTL_CONSTEXPR_14 AuFalseType TestIsPtrConvertible(const volatile void *);
template <class, typename>
auto TestIsBaseOf(...) -> AuTrueType;
@ -84,9 +84,12 @@ namespace _audetail
template <class B, typename D>
auto TestIsBaseOf(int) -> decltype(TestIsPtrConvertible<B>(static_cast<D *>(nullptr)));
#if defined(AU_LANG_CPP_20_)
// yoinked: https://stackoverflow.com/a/40867906
template<typename Func, typename...Params> static auto IsCallable(int) -> decltype((void)AuDeclVal<Func>()(AuDeclVal<Params>()...), AuTrueType {});
template<typename Func, typename...Params> static AuFalseType IsCallable(...);
#endif
}
template <class T>
@ -94,7 +97,7 @@ struct AuIsClass : decltype(_audetail::IsClass<T>(nullptr))
{};
template <class T>
inline AUROXTL_CONSTEXPR bool AuIsClass_v = AuIsClass<T>::value;
AUROXTL_CONSTEXPR_14 bool AuIsClass_v = AuIsClass<T>::value;
template <class Base, typename Derived>
struct AuIsBaseOf :
@ -106,43 +109,43 @@ struct AuIsBaseOf :
{};
template <class Base, typename Derived>
inline AUROXTL_CONSTEXPR bool AuIsBaseOf_v = AuIsBaseOf<Base, Derived>::value;
AUROXTL_CONSTEXPR_14 bool AuIsBaseOf_v = AuIsBaseOf<Base, Derived>::value;
template <class>
inline AUROXTL_CONSTEXPR bool AuIsPointer_v = false;
AUROXTL_CONSTEXPR_14 bool AuIsPointer_v = false;
template <class T>
inline AUROXTL_CONSTEXPR bool AuIsPointer_v<T *> = true;
AUROXTL_CONSTEXPR_14 bool AuIsPointer_v<T *> = true;
template <class T>
inline AUROXTL_CONSTEXPR bool AuIsPointer_v<T *const> = true;
AUROXTL_CONSTEXPR_14 bool AuIsPointer_v<T *const> = true;
template <class T>
inline AUROXTL_CONSTEXPR bool AuIsPointer_v<T *volatile> = true;
AUROXTL_CONSTEXPR_14 bool AuIsPointer_v<T *volatile> = true;
template <class T>
inline AUROXTL_CONSTEXPR bool AuIsPointer_v<T *const volatile> = true;
AUROXTL_CONSTEXPR_14 bool AuIsPointer_v<T *const volatile> = true;
template <class>
inline AUROXTL_CONSTEXPR bool AuIsReference_v = false;
AUROXTL_CONSTEXPR_14 bool AuIsReference_v = false;
template <class T>
inline AUROXTL_CONSTEXPR bool AuIsReference_v<T &> = true;
AUROXTL_CONSTEXPR_14 bool AuIsReference_v<T &> = true;
template <class T>
inline AUROXTL_CONSTEXPR bool AuIsReference_v<T &&> = true;
AUROXTL_CONSTEXPR_14 bool AuIsReference_v<T &&> = true;
template <class>
inline AUROXTL_CONSTEXPR bool AuIsLValueReference_v = false;
AUROXTL_CONSTEXPR_14 bool AuIsLValueReference_v = false;
template <class T>
inline AUROXTL_CONSTEXPR bool AuIsLValueReference_v<T &> = true;
AUROXTL_CONSTEXPR_14 bool AuIsLValueReference_v<T &> = true;
template <class>
inline AUROXTL_CONSTEXPR bool AuIsRValueReference_v = false;
AUROXTL_CONSTEXPR_14 bool AuIsRValueReference_v = false;
template <class T>
inline AUROXTL_CONSTEXPR bool AuIsRValueReference_v<T &&> = true;
AUROXTL_CONSTEXPR_14 bool AuIsRValueReference_v<T &&> = true;
template <class T>
struct AuRemovePointer
@ -181,7 +184,7 @@ template <class T>
using AuIsVoid = AuIsSame<void, T>;
template <class T>
inline AUROXTL_CONSTEXPR bool AuIsVoid_v = AuIsVoid<T>::value;
AUROXTL_CONSTEXPR_17 bool AuIsVoid_v = AuIsVoid<T>::value;
template <class T>
struct AuRemoveReference
@ -311,13 +314,13 @@ template <class ... Ts>
using AuVoid_t = void;
template <class>
AUROXTL_CONSTEXPR inline bool AuIsArray_v = false;
AUROXTL_CONSTEXPR_17 bool AuIsArray_v = false;
template <class T, size_t Len>
inline AUROXTL_CONSTEXPR bool AuIsArray_v<T[Len]> = true;
AUROXTL_CONSTEXPR_17 bool AuIsArray_v<T[Len]> = true;
template <class T>
inline AUROXTL_CONSTEXPR bool AuIsArray_v<T[]> = true;
AUROXTL_CONSTEXPR_17 bool AuIsArray_v<T[]> = true;
template <bool Test, class T = void>
using AuEnableIf_t = typename AuEnableIf<Test, T>::type;
@ -346,7 +349,7 @@ using AuIsConstructible_t = typename AuIsConstructible<T, Args ...>::type;
#endif
template <class T, class ... Args>
inline AUROXTL_CONSTEXPR bool AuIsConstructible_v = AuIsConstructible<T, Args ...>::type::value;
AUROXTL_CONSTEXPR_17 bool AuIsConstructible_v = AuIsConstructible<T, Args ...>::type::value;
template <bool Test, class T, class T2>
struct AuConditional
@ -363,6 +366,8 @@ struct AuConditional<false, T, T2>
template <bool Test, class T, class T2>
using AuConditional_t = typename AuConditional<Test, T, T2>::type;
#if defined(AAU_LANG_CPP_17_)
template <class T>
using AuDecay_t = AuConditional_t<
AuIsArray_v<T>,
@ -374,6 +379,11 @@ using AuDecay_t = AuConditional_t<
>
>;
#else
template< class T >
using AuDecay_t = typename std::decay<T>::type;
#endif
template <class T>
struct AuDecay
{
@ -384,8 +394,8 @@ template <template <class...> class Base, typename Derived>
struct AuIsBaseOfTemplateImpl
{
template <class... Ts>
static AUROXTL_CONSTEXPR AuTrueType Test(const Base<Ts...> *);
static AUROXTL_CONSTEXPR AuFalseType Test(...);
static AUROXTL_CONSTEXPR_17 AuTrueType Test(const Base<Ts...> *);
static AUROXTL_CONSTEXPR_17 AuFalseType Test(...);
using type = decltype(Test(AuDeclVal<AuRemoveReference_t<Derived> *>()));
};
@ -393,7 +403,7 @@ template <template <class...> class Base, typename Derived>
using AuIsBaseOfTemplate = typename AuIsBaseOfTemplateImpl<Base, Derived>::type;
template <template <class...> class Base, typename Derived>
inline AUROXTL_CONSTEXPR bool AuIsBaseOfTemplate_v = AuIsBaseOfTemplateImpl<Base, Derived>::type::value;
AUROXTL_CONSTEXPR_17 bool AuIsBaseOfTemplate_v = AuIsBaseOfTemplateImpl<Base, Derived>::type::value;
#if !defined(AURORA_ROXTL_NO_STD)
@ -403,7 +413,7 @@ inline AUROXTL_CONSTEXPR bool AuIsBaseOfTemplate_v = AuIsBaseOfTemplateImpl<Base
#if defined(AU_LANG_CPP_14)
template <class T, class... Args>
using AuResultOf_t = typename std::result_of_t<T, Args...>;
using AuResultOf_t = typename std::result_of_t<T&&(Args&&...)>;
#else
template <class T, class... Args>
using AuResultOf_t = typename std::invoke_result_t<T, Args...>;
@ -411,9 +421,99 @@ inline AUROXTL_CONSTEXPR bool AuIsBaseOfTemplate_v = AuIsBaseOfTemplateImpl<Base
#endif
#if defined(AU_LANG_CPP_20_)
template <class Func, class ...Params>
struct AuCallable : decltype(_audetail::IsCallable<Func, Params...>(0))
{
#else
template<typename T, typename U = void>
struct AuCallable
{
static bool const constexpr value = AuConditional_t<
AuIsClass<AuRemoveReference_t<T>>::value,
AuCallable<AuRemoveReference_t<T>, int>, std::false_type>::value;
};
template<typename T, typename U, typename ...Args>
struct AuCallable<T(Args...), U> : AuTrueType {};
template<typename T, typename U, typename ...Args>
struct AuCallable<T(*)(Args...), U> : AuTrueType {};
template<typename T, typename U, typename ...Args>
struct AuCallable<T(&)(Args...), U> : AuTrueType {};
template<typename T, typename U, typename ...Args>
struct AuCallable<T(Args......), U> : AuTrueType {};
template<typename T, typename U, typename ...Args>
struct AuCallable<T(*)(Args......), U> : AuTrueType {};
template<typename T, typename U, typename ...Args>
struct AuCallable<T(&)(Args......), U> : AuTrueType {};
template<typename T, typename U, typename ...Args>
struct AuCallable<T(Args...)const, U> : AuTrueType {};
template<typename T, typename U, typename ...Args>
struct AuCallable<T(Args...)volatile, U> : AuTrueType {};
template<typename T, typename U, typename ...Args>
struct AuCallable<T(Args...)const volatile, U> : AuTrueType {};
template<typename T, typename U, typename ...Args>
struct AuCallable<T(Args......)const, U> : AuTrueType {};
template<typename T, typename U, typename ...Args>
struct AuCallable<T(Args......)volatile, U> : AuTrueType{};
template<typename T, typename U, typename ...Args>
struct AuCallable<T(Args......)const volatile, U> : AuTrueType {};
template<typename T, typename U, typename ...Args>
struct AuCallable<T(Args...)&, U> : AuTrueType {};
template<typename T, typename U, typename ...Args>
struct AuCallable<T(Args...)const&, U> : AuTrueType{};
template<typename T, typename U, typename ...Args>
struct AuCallable<T(Args...)volatile&, U> : AuTrueType{};
template<typename T, typename U, typename ...Args>
struct AuCallable<T(Args...)const volatile&, U> : AuTrueType{};
template<typename T, typename U, typename ...Args>
struct AuCallable<T(Args......)&, U> : AuTrueType {};
template<typename T, typename U, typename ...Args>
struct AuCallable<T(Args......)const&, U> : AuTrueType{};
template<typename T, typename U, typename ...Args>
struct AuCallable<T(Args......)volatile&, U> : AuTrueType{};
template<typename T, typename U, typename ...Args>
struct AuCallable<T(Args......)const volatile&, U> : AuTrueType{};
template<typename T, typename U, typename ...Args>
struct AuCallable<T(Args...)&&, U> : AuTrueType{};
template<typename T, typename U, typename ...Args>
struct AuCallable<T(Args...)const&&, U> : AuTrueType{};
template<typename T, typename U, typename ...Args>
struct AuCallable<T(Args...)volatile&&, U> : AuTrueType{};
template<typename T, typename U, typename ...Args>
struct AuCallable<T(Args...)const volatile&&, U> : AuTrueType{};
template<typename T, typename U, typename ...Args>
struct AuCallable<T(Args......)&&, U> : AuTrueType{};
template<typename T, typename U, typename ...Args>
struct AuCallable<T(Args......)const&&, U> : AuTrueType{};
template<typename T, typename U, typename ...Args>
struct AuCallable<T(Args......)volatile&&, U> : AuTrueType{};
template<typename T, typename U, typename ...Args>
struct AuCallable<T(Args......)const volatile&&, U> : AuTrueType{};
template<typename T>
struct AuCallable<T, int>
{
private:
using YesType = char(&)[1];
using NoType = char(&)[2];
struct Fallback { void operator()(); };
struct Derived : T, Fallback {};
template<typename U, U>
struct Check;
template<typename>
static YesType Test(...);
template<typename C>
static NoType Test(Check<void (Fallback::*)(), &C::operator()>*);
public:
static bool const constexpr value = sizeof(Test<Derived>(0)) == sizeof(YesType);
#endif
};
template <class F, class... Args>
@ -618,11 +718,13 @@ namespace _audetail
template<class>
auto test_returnable(...) -> AuFalseType;
#if defined(AU_LANG_CPP_20_)
template<class From, class To>
auto test_implicitly_convertible(int) -> decltype(void(AuDeclType<void(&)(To)>()(AuDeclType<From>())), AuTrueType {});
template<class, class>
auto test_implicitly_convertible(...) -> AuFalseType;
#endif
}
template <class T, class T2>

View File

@ -100,7 +100,7 @@ struct AuIsFunction<Ret(Args......) const volatile &&> : AuTrueType {};
// specializations for noexcept versions of all the above (C++17 and later)
#if defined(AU_LANG_CPP_17_)
template <class Ret, class... Args>
struct AuIsFunction<Ret(Args...) noexcept> : AuTrueType {};
@ -172,9 +172,10 @@ struct AuIsFunction<Ret(Args......) volatile && noexcept> : AuTrueType {};
template <class Ret, class... Args>
struct AuIsFunction<Ret(Args......) const volatile && noexcept> : AuTrueType {};
#endif
template <class T>
inline constexpr bool AuIsFunction_v = AuIsFunction<T>::value;
AU_CONSTEXPR_17 bool AuIsFunction_v = AuIsFunction<T>::value;
#if defined(AURORA_COMPILER_CLANG)
#pragma clang diagnostic pop

View File

@ -21,7 +21,7 @@ struct AuErrorCode_t : AuCallErrorTag
{
AuUInt32 uValue;
inline constexpr AuErrorCode_t()
inline constexpr AuErrorCode_t() : uValue(0)
{};
inline constexpr AuErrorCode_t(AuUInt32 uValue) : uValue(uValue)

View File

@ -21,7 +21,8 @@ struct AuCtorCode_t : AuCtorErrorTag
{
bool value;
inline constexpr AuCtorCode_t()
inline constexpr AuCtorCode_t() :
value(false)
{};
inline constexpr AuCtorCode_t(bool val) : value(val)

View File

@ -64,7 +64,7 @@ struct AuIsPair_C<T, AuEnableIf_t<!IsPairImpl<T>::value>>
};
template <class T>
constexpr inline bool AuIsPair_v = AuIsSame_v<typename AuIsPair_C<AuRemoveCV_t<T>>::type, AuRemoveCV_t<T>>;
constexpr bool AuIsPair_v = AuIsSame_v<typename AuIsPair_C<AuRemoveCV_t<T>>::type, AuRemoveCV_t<T>>;
template <class... Args>
static auto AuMakePair(Args&&... args)
@ -81,7 +81,7 @@ struct AuIsTuple<AuTuple<Ts...>> : AuTrueType
{ };
template <class T>
inline constexpr bool AuIsTuple_v = AuIsTuple<T>::type::value;
constexpr bool AuIsTuple_v = AuIsTuple<T>::type::value;
template <class... Args>
static auto AuMakeTuple(Args&&... args)
@ -126,7 +126,7 @@ static auto AuTupleApply(F &&f, Tuple &&t)
}
template <class T>
inline constexpr AuUInt AuTupleCountOf_v = AURORA_RUNTIME_TUPLE_SIZE<AuRemoveConst_t<AuRemoveReference_t<T>>>::value;
constexpr AuUInt AuTupleCountOf_v = AURORA_RUNTIME_TUPLE_SIZE<AuRemoveConst_t<AuRemoveReference_t<T>>>::value;
namespace __audetail
{

View File

@ -13,11 +13,12 @@ using CodepointOffset_t = AuUInt;
// AuStringUtils.hpp fwd decl
static constexpr CodepointByteOffset_t AuCodepointsFindByteOffsetUnsafe(const AuROString &in,
const AuROString &find,
CodepointByteOffset_t uStartPosition = {});
static auline constexpr bool AuEndsWith(AuROString const &value, AuROString const &ending);
static auline constexpr bool AuStartsWith(AuROString const &value, AuROString const &starting);
static AUROXTL_CONSTEXPR_17 CodepointByteOffset_t AuCodepointsFindByteOffsetUnsafe(const AuROString &in,
const AuROString &find,
CodepointByteOffset_t uStartPosition = {});
static auline AU_CONSTEXPR_17 bool AuEndsWith(AuROString const &value, AuROString const &ending);
static auline AU_CONSTEXPR_17 bool AuStartsWith(AuROString const &value, AuROString const &starting);
// TODO: implement AuStringView (does not exist yet) (without std::string_view)
@ -26,14 +27,14 @@ static auline constexpr bool AuStartsWith(AuROString const &value, AuROString co
#include "Strings/auROString.hpp"
#include "Strings/auRONString.hpp"
inline constexpr bool operator==(const AuROString &lhs,
const AuROString &rhs) noexcept
inline AUROXTL_CONSTEXPR_17 bool operator==(const AuROString &lhs,
const AuROString &rhs) noexcept
{
return lhs.compare(rhs) == 0;
}
inline constexpr bool operator==(const AuRONString &lhs,
const AuRONString &rhs) noexcept
inline AUROXTL_CONSTEXPR_17 bool operator==(const AuRONString &lhs,
const AuRONString &rhs) noexcept
{
return AuROString(lhs) == AuROString(rhs);
}

View File

@ -17,7 +17,9 @@
#include <algorithm>
#include <unordered_map>
#include <memory>
#if defined(AU_LANG_CPP_17_)
#include <optional>
#endif
#include <functional>
#else
@ -44,114 +46,114 @@
// this needs to be after template mater and before containers and optional
namespace __audetail
{
#define _AUROXTL_DETAIAL_HAS(name) \
template <class T> \
struct AuHas ## name \
{ \
template <class C> static constexpr AuTrueType Test(decltype(&C::name)); \
template <class C> static constexpr AuFalseType Test(...); \
using type = decltype(Test<T>(0)); \
}; \
\
template <class T> \
constexpr inline bool AuHas ## name ## _v = AuHas ## name<T>::type::value;
#define _AUROXTL_DETAIAL_HAS(name) \
template <class T> \
struct AuHas ## name \
{ \
template <class C> static AUROXTL_CONSTEXPR_17 AuTrueType Test(decltype(&C::name)); \
template <class C> static AUROXTL_CONSTEXPR_17 AuFalseType Test(...); \
using type = decltype(Test<T>(0)); \
}; \
\
template <class T> \
constexpr AU_INLINE_20 bool AuHas ## name ## _v = AuHas ## name<T>::type::value;
_AUROXTL_DETAIAL_HAS(has_value);
_AUROXTL_DETAIAL_HAS(capacity)
_AUROXTL_DETAIAL_HAS(size)
_AUROXTL_DETAIAL_HAS(reserve)
template <class T>
constexpr inline bool AuIsPreallocatable_v = AuHascapacity_v<T> && AuHasreserve_v<T>;
constexpr AU_INLINE_20 bool AuIsPreallocatable_v = AuHascapacity_v<T> && AuHasreserve_v<T>;
template <class T>
struct AuHastry_emplace
{
template <class C> static constexpr AuTrueType Test(decltype(&C::try_emplace));
template <class C> static constexpr AuFalseType Test(...);
template <class C> static AUROXTL_CONSTEXPR_17 AuTrueType Test(decltype(&C::try_emplace));
template <class C> static AUROXTL_CONSTEXPR_17 AuFalseType Test(...);
using type = decltype(Test<T>(0));
};
template <class T>
constexpr inline bool AuHastry_emplace_v = false;// <T>::type::value;
constexpr AU_INLINE_20 bool AuHastry_emplace_v = false;// <T>::type::value;
template <class T>
struct AuHasemplace
{
template <class C> static constexpr AuTrueType Test(decltype(&C::emplace));
template <class C> static constexpr AuFalseType Test(...);
template <class C> static AUROXTL_CONSTEXPR_17 AuTrueType Test(decltype(&C::emplace));
template <class C> static AUROXTL_CONSTEXPR_17 AuFalseType Test(...);
using type = decltype(Test<T>(0));
};
template <class T>
constexpr inline bool AuHasemplace_v = true;//AuHasemplace<T>::type::value;
constexpr AU_INLINE_20 bool AuHasemplace_v = true;//AuHasemplace<T>::type::value;
template <class T>
struct AuHasfind
{
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(...);
template <class C> static AUROXTL_CONSTEXPR_17 AuTrueType Test(decltype(static_cast<typename C::const_iterator(C:: *)(const typename C::key_type &) const>(&C::find)));
template <class C> static AUROXTL_CONSTEXPR_17 AuTrueType Test(decltype(static_cast<typename C::const_iterator(C:: *)(const typename C::element_type &) const>(&C::find)));
template <class C> static AUROXTL_CONSTEXPR_17 AuFalseType Test(...);
using type = decltype(Test<T>(0));
};
template <class T>
constexpr inline bool AuHasfind_v = AuHasfind<T>::type::value;
constexpr AU_INLINE_20 bool AuHasfind_v = AuHasfind<T>::type::value;
template <class T>
struct AuHasFind
{
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(...);
template <class C> static AUROXTL_CONSTEXPR_17 AuTrueType Test(decltype(static_cast<typename C::const_iterator(C:: *)(const typename C::key_type &) const>(&C::Find)));
template <class C> static AUROXTL_CONSTEXPR_17 AuTrueType Test(decltype(static_cast<typename C::const_iterator(C:: *)(const typename C::element_type &) const>(&C::Find)));
template <class C> static AUROXTL_CONSTEXPR_17 AuFalseType Test(...);
using type = decltype(Test<T>(0));
};
template <class T>
constexpr inline bool AuHasFind_v = AuHasFind<T>::type::value;
constexpr AU_INLINE_20 bool AuHasFind_v = AuHasFind<T>::type::value;
template <class T>
struct AuHasend
{
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(...);
template <class C> static AUROXTL_CONSTEXPR_17 AuTrueType Test(decltype(static_cast<typename C::const_iterator(C:: *)() const>(&C::end)));
template <class C> static AUROXTL_CONSTEXPR_17 AuFalseType Test(...);
using type = decltype(Test<T>(0));
};
template <class T>
constexpr inline bool AuHasend_v = AuHasend<T>::type::value;
constexpr AU_INLINE_20 bool AuHasend_v = AuHasend<T>::type::value;
template <class T>
struct AuHasEnd
{
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(...);
template <class C> static AUROXTL_CONSTEXPR_17 AuTrueType Test(decltype(static_cast<typename C::const_iterator(C:: *)() const>(&C::End)));
template <class C> static AUROXTL_CONSTEXPR_17 AuFalseType Test(...);
using type = decltype(Test<T>(0));
};
template <class T>
constexpr inline bool AuHasEnd_v = AuHasEnd<T>::type::value;
constexpr AU_INLINE_20 bool AuHasEnd_v = AuHasEnd<T>::type::value;
template <class T>
struct AuHasbegin
{
template <class C> static constexpr AuTrueType Test(decltype(static_cast<typename C::const_iterator(C:: *)() const>(&C::begin)));
template <class C> static constexpr AuFalseType Test(...);
template <class C> static AUROXTL_CONSTEXPR_17 AuTrueType Test(decltype(static_cast<typename C::const_iterator(C:: *)() const>(&C::begin)));
template <class C> static AUROXTL_CONSTEXPR_17 AuFalseType Test(...);
using type = decltype(Test<T>(0));
};
template <class T>
constexpr inline bool AuHasbegin_v = AuHasbegin<T>::type::value;
constexpr AU_INLINE_20 bool AuHasbegin_v = AuHasbegin<T>::type::value;
template <class T>
struct AuHasBegin
{
template <class C> static constexpr AuTrueType Test(decltype(static_cast<typename C::const_iterator(C:: *)() const>(&C::Begin)));
template <class C> static constexpr AuFalseType Test(...);
template <class C> static AUROXTL_CONSTEXPR_17 AuTrueType Test(decltype(static_cast<typename C::const_iterator(C:: *)() const>(&C::Begin)));
template <class C> static AUROXTL_CONSTEXPR_17 AuFalseType Test(...);
using type = decltype(Test<T>(0));
};
template <class T>
constexpr inline bool AuHasBegin_v = AuHasBegin<T>::type::value;
constexpr AU_INLINE_20 bool AuHasBegin_v = AuHasBegin<T>::type::value;
template <class T>
AuUInt HashCode(const T &hashCode);
@ -175,11 +177,14 @@ namespace __audetail
#include <auROXTL/auOptionalEx.hpp>
#include <auROXTL/Iterators/auUTF8Iterator.hpp>
namespace Aurora::Memory
namespace Aurora
{
inline void ThrowNullException()
namespace Memory
{
AU_THROW_STRING("ExSharedPointer Null Access Violation");
inline void ThrowNullException()
{
AU_THROW_STRING("ExSharedPointer Null Access Violation");
}
}
}