From 1787718e258f0e3c7673b5886c098878fb8a17f6 Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 1 Sep 2016 11:52:08 +0200 Subject: Core/Random: Remove no longer needed hack for VS 2013 (cherry picked from commit 59fe9087447dc58c3f41fb6f647bc2b50a95b9b5) --- src/common/Utilities/Containers.h | 4 +--- src/common/Utilities/Random.h | 22 ---------------------- 2 files changed, 1 insertion(+), 25 deletions(-) (limited to 'src') diff --git a/src/common/Utilities/Containers.h b/src/common/Utilities/Containers.h index 9bdc0999cf5..dda48858878 100644 --- a/src/common/Utilities/Containers.h +++ b/src/common/Utilities/Containers.h @@ -20,7 +20,6 @@ #include "Define.h" #include "Random.h" -#include "Util.h" #include #include #include @@ -84,8 +83,7 @@ namespace Trinity template typename C::const_iterator SelectRandomWeightedContainerElement(C const& container, std::vector weights) { - Trinity::discrete_distribution_param ddParam(weights.begin(), weights.end()); - std::discrete_distribution dd(ddParam); + std::discrete_distribution dd(weights.begin(), weights.end()); typename C::const_iterator it = container.begin(); std::advance(it, dd(SFMTEngine::Instance())); return it; diff --git a/src/common/Utilities/Random.h b/src/common/Utilities/Random.h index 18afd6e023b..94a36db42f6 100644 --- a/src/common/Utilities/Random.h +++ b/src/common/Utilities/Random.h @@ -74,26 +74,4 @@ public: static SFMTEngine& Instance(); }; -// Ugly, horrible, i don't even..., hack for VS2013 to work around missing discrete_distribution(iterator, iterator) constructor -namespace Trinity -{ -#if COMPILER == COMPILER_MICROSOFT && _MSC_VER <= 1800 - template - struct discrete_distribution_param : public std::discrete_distribution::param_type - { - typedef typename std::discrete_distribution::param_type base; - - template - discrete_distribution_param(InIt begin, InIt end) : base(_Noinit()) - { - this->_Pvec.assign(begin, end); - this->_Init(); - } - }; -#else - template - using discrete_distribution_param = typename std::discrete_distribution::param_type; -#endif -} - #endif // Random_h__ -- cgit v1.2.3