diff --git a/src/common/Utilities/Containers.h b/src/common/Utilities/Containers.h index c037ffd243b..ca0c9c49263 100644 --- a/src/common/Utilities/Containers.h +++ b/src/common/Utilities/Containers.h @@ -166,6 +166,20 @@ namespace Trinity return SelectRandomWeightedContainerElement(container, weights); } + /** + * @fn void Trinity::Containers::RandomShuffle(Iterator begin, Iterator end) + * + * @brief Reorder the elements of the iterator range randomly. + * + * @param begin Beginning of the range to reorder + * @param end End of the range to reorder + */ + template + inline void RandomShuffle(Iterator begin, Iterator end) + { + std::shuffle(begin, end, RandomEngine::Instance()); + } + /** * @fn void Trinity::Containers::RandomShuffle(C& container) * @@ -176,7 +190,7 @@ namespace Trinity template inline void RandomShuffle(C& container) { - std::shuffle(std::begin(container), std::end(container), RandomEngine::Instance()); + RandomShuffle(std::begin(container), std::end(container)); } /**