[*] Thy shall not spam Exception Handler frames unlike those who practice such idioms as noexcept in the fuckfest that is Cope++

This commit is contained in:
Reece Wilson 2022-03-25 22:38:45 +00:00
parent 7ebffdf917
commit 5b91d0c30e

View File

@ -11,22 +11,22 @@
#pragma once
template <class T, bool all>
static bool _AuRemoveIfBase(T &in, const AuPredicate<const AuToValueType_t<T> &> &predicate);
inline bool _AuRemoveIfBase(T &in, const AuPredicate<const AuToValueType_t<T> &> &predicate);
template <class T>
static bool AuRemoveAllIf(T &in, const AuPredicate<const AuToValueType_t<T> &> &predicate)
inline bool AuRemoveAllIf(T &in, const AuPredicate<const AuToValueType_t<T> &> &predicate)
{
return _AuRemoveIfBase<T, true>(in, predicate);
}
template <class T>
static bool AuRemoveIf(T &in, const AuPredicate<const AuToValueType_t<T> &> &predicate)
inline bool AuRemoveIf(T &in, const AuPredicate<const AuToValueType_t<T> &> &predicate)
{
return _AuRemoveIfBase<T, false>(in, predicate);
}
template <class T, typename Z>
static bool AuTryRemove(T &in, const Z &type)
inline bool AuTryRemove(T &in, const Z &type)
{
try
{
@ -45,7 +45,7 @@ static bool AuTryRemove(T &in, const Z &type)
}
template <class T, typename Z>
static void AuRemove(T &in, const Z &type)
inline void AuRemove(T &in, const Z &type)
{
auto itr = in.find(type);
if (itr == in.end())
@ -56,7 +56,7 @@ static void AuRemove(T &in, const Z &type)
}
template <class T>
static void AuRemoveRange(T &in, AuUInt index, AuUInt length)
inline void AuRemoveRange(T &in, AuUInt index, AuUInt length)
{
if (index + length > in.size())
{
@ -77,7 +77,7 @@ static void AuRemoveRange(T &in, AuUInt index, AuUInt length)
}
template <class T>
static bool AuTryRemoveRange(T &in, AuUInt index, AuUInt length)
inline bool AuTryRemoveRange(T &in, AuUInt index, AuUInt length)
{
try
{
@ -105,7 +105,7 @@ static bool AuTryRemoveRange(T &in, AuUInt index, AuUInt length)
}
template <class Map, class Key, typename Value>
static auline bool AuTryFind(Map &map, const Key &key, Value *&ptr)
inline bool AuTryFind(Map &map, const Key &key, Value *&ptr)
{
auto itr = map.find(key);
if (itr != map.end())
@ -121,7 +121,7 @@ static auline bool AuTryFind(Map &map, const Key &key, Value *&ptr)
}
template <class Map, class Key, typename Value>
static auline bool AuTryFind(Map *map, const Key &key, Value *&ptr)
inline bool AuTryFind(Map *map, const Key &key, Value *&ptr)
{
auto itr = map->find(key);
if (itr != map->end())
@ -137,7 +137,7 @@ static auline bool AuTryFind(Map *map, const Key &key, Value *&ptr)
}
template <class Map, class Key>
static auline bool AuTryFind(Map &map, const Key &key)
inline bool AuTryFind(Map &map, const Key &key)
{
auto itr = map.find(key);
if (itr != map.end())
@ -151,7 +151,7 @@ static auline bool AuTryFind(Map &map, const Key &key)
}
template <AuUInt N, typename List, class Key>
static auline auto AuTryFindByTupleN(List &list, const Key &key)
inline auto AuTryFindByTupleN(List &list, const Key &key)
{
for (auto itr = list.begin(); itr != list.end(); )
{
@ -168,13 +168,13 @@ static auline auto AuTryFindByTupleN(List &list, const Key &key)
}
template <class Range, class Key>
static auline bool AuExists(Range &a, const Key &item)
inline bool AuExists(Range &a, const Key &item)
{
return std::find(a.begin(), a.end(), item) != a.end();
}
template <class Map, class Key>
static auline bool AuTryFind(Map *map, const Key &key)
inline bool AuTryFind(Map *map, const Key &key)
{
auto itr = map->find(key);
if (itr != map->end())
@ -188,7 +188,7 @@ static auline bool AuTryFind(Map *map, const Key &key)
}
template <class Map, class Key, typename Value>
static auline bool AuTryFindGeneric(Map &map, const Key &key, Value *&ptr)
inline bool AuTryFindGeneric(Map &map, const Key &key, Value *&ptr)
{
auto itr = map.find(key);
if (itr != map.end())
@ -204,7 +204,7 @@ static auline bool AuTryFindGeneric(Map &map, const Key &key, Value *&ptr)
}
template <class Map, class Key>
static auline bool AuTryFindGeneric(Map &map, const Key &key)
inline bool AuTryFindGeneric(Map &map, const Key &key)
{
if (map.find(key) != map.end())
{
@ -217,14 +217,14 @@ static auline bool AuTryFindGeneric(Map &map, const Key &key)
}
template <class Container>
static auline bool AuTryClear(Container &container)
inline bool AuTryClear(Container &container)
{
container.clear(); // clears are generally noexcept.
return true;
}
template <class Map, class Key>
static auline bool AuTryDelete(Map &map, const Key &key)
inline bool AuTryDelete(Map &map, const Key &key)
{
auto itr = map.find(key);
if (itr != map.end())
@ -240,7 +240,7 @@ static auline bool AuTryDelete(Map &map, const Key &key)
/// @deprecated -> Should've been named AuTryRemoveList
template <class List, class Key>
static auline bool AuTryDeleteList(List &list, const Key &key)
inline bool AuTryDeleteList(List &list, const Key &key)
{
auto itr = std::find(list.begin(), list.end(), key);
if (itr != list.end())
@ -255,7 +255,7 @@ static auline bool AuTryDeleteList(List &list, const Key &key)
}
template <class List, class Key>
static auline bool AuTryRemoveList(List &list, const Key &key)
inline bool AuTryRemoveList(List &list, const Key &key)
{
auto itr = std::find(list.begin(), list.end(), key);
if (itr != list.end())
@ -270,7 +270,7 @@ static auline bool AuTryRemoveList(List &list, const Key &key)
}
template <AuUInt N, typename List, class Key>
static auline bool AuTryRemoveByTupleN(List &list, const Key &key)
inline bool AuTryRemoveByTupleN(List &list, const Key &key)
{
for (auto itr = list.begin(); itr != list.end(); )
{
@ -291,7 +291,7 @@ static auline bool AuTryRemoveByTupleN(List &list, const Key &key)
#include <auROXTL/auTupleUtils.hpp>
template <class Container, typename Key_t, typename Type_t>
static auline bool AuTryInsert(Container &container, const Key_t &key, Type_t &&value)
inline bool AuTryInsert(Container &container, const Key_t &key, Type_t &&value)
{
try
{
@ -313,7 +313,7 @@ static auline bool AuTryInsert(Container &container, const Key_t &key, Type_t &&
}
template <class Container, typename Type>
static auline bool AuTryInsert(Container &container, const Type &value)
inline bool AuTryInsert(Container &container, const Type &value)
{
try
{
@ -327,7 +327,7 @@ static auline bool AuTryInsert(Container &container, const Type &value)
}
}
template <class Container, typename Type>
static auline bool AuTryInsert(Container &container, Type &&value)
inline bool AuTryInsert(Container &container, Type &&value)
{
try
{
@ -342,7 +342,7 @@ static auline bool AuTryInsert(Container &container, Type &&value)
}
template <class Container, typename Type>
static auline bool AuTryInsert(Container *container, const Type &value)
inline bool AuTryInsert(Container *container, const Type &value)
{
try
{
@ -357,7 +357,7 @@ static auline bool AuTryInsert(Container *container, const Type &value)
}
template <class Container, typename Type>
static auline bool AuTryInsert(Container *container, Type &&value)
inline bool AuTryInsert(Container *container, Type &&value)
{
try
{
@ -372,7 +372,7 @@ static auline bool AuTryInsert(Container *container, Type &&value)
}
template <class Container, typename Type>
static auline bool AuTryInsertNoEnd(Container &container, Type &&value) // move
inline bool AuTryInsertNoEnd(Container &container, Type &&value) // move
{
try
{
@ -387,7 +387,7 @@ static auline bool AuTryInsertNoEnd(Container &container, Type &&value) // move
}
template <class Container, typename Type>
static auline bool AuTryInsertNoEnd(Container &container, const Type &value) // copy
inline bool AuTryInsertNoEnd(Container &container, const Type &value) // copy
{
try
{
@ -402,7 +402,7 @@ static auline bool AuTryInsertNoEnd(Container &container, const Type &value) //
}
template <class Container, typename Type>
static auline bool AuTryInsertNoEnd(Container *container, Type &&value) // move
inline bool AuTryInsertNoEnd(Container *container, Type &&value) // move
{
try
{
@ -417,7 +417,7 @@ static auline bool AuTryInsertNoEnd(Container *container, Type &&value) // move
}
template <class Container, typename Type>
static auline bool AuTryInsertNoEnd(Container *container, const Type &value) // copy
inline bool AuTryInsertNoEnd(Container *container, const Type &value) // copy
{
try
{
@ -437,7 +437,7 @@ namespace Aurora::Memory
}
template <class T>
static auline bool AuTryResize(T &list, AuUInt length)
inline bool AuTryResize(T &list, AuUInt length)
{
try
{
@ -458,7 +458,7 @@ static auline bool AuTryResize(T &list, AuUInt length)
}
template <class T>
static auline bool AuTryDownsize(T &list, AuUInt length)
inline bool AuTryDownsize(T &list, AuUInt length)
{
try
{
@ -486,7 +486,7 @@ static auline bool AuTryDownsize(T &list, AuUInt length)
}
template <class T, bool all>
static bool _AuRemoveIfBase(T &in, const AuPredicate<const AuToValueType_t<T> &> &predicate)
inline bool _AuRemoveIfBase(T &in, const AuPredicate<const AuToValueType_t<T> &> &predicate)
{
bool retOne {};