mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-15 16:26:08 +00:00
refactor(Core/Misc): acore to Acore (#6043)
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
namespace acore
|
||||
namespace Acore
|
||||
{
|
||||
template<class T>
|
||||
constexpr inline T* AddressOrSelf(T* ptr)
|
||||
@@ -60,14 +60,14 @@ namespace acore
|
||||
};
|
||||
}
|
||||
|
||||
namespace acore::Containers
|
||||
namespace Acore::Containers
|
||||
{
|
||||
// resizes <container> to have at most <requestedSize> elements
|
||||
// if it has more than <requestedSize> elements, the elements to keep are selected randomly
|
||||
template<class C>
|
||||
void RandomResize(C& container, std::size_t requestedSize)
|
||||
{
|
||||
static_assert(std::is_base_of<std::forward_iterator_tag, typename std::iterator_traits<typename C::iterator>::iterator_category>::value, "Invalid container passed to acore::Containers::RandomResize");
|
||||
static_assert(std::is_base_of<std::forward_iterator_tag, typename std::iterator_traits<typename C::iterator>::iterator_category>::value, "Invalid container passed to Acore::Containers::RandomResize");
|
||||
|
||||
if (std::size(container) <= requestedSize)
|
||||
return;
|
||||
@@ -176,7 +176,7 @@ namespace acore::Containers
|
||||
}
|
||||
|
||||
/*
|
||||
* @fn void acore::Containers::RandomShuffle(C& container)
|
||||
* @fn void Acore::Containers::RandomShuffle(C& container)
|
||||
*
|
||||
* @brief Reorder the elements of the container randomly.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user