aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2016-09-01 11:52:08 +0200
committerShauren <shauren.trinity@gmail.com>2016-09-01 11:52:08 +0200
commit59fe9087447dc58c3f41fb6f647bc2b50a95b9b5 (patch)
tree7277d32f785c46c5300344ed7b15c5432e603c38 /src
parent9c9a6f9f37e307f35e015f8f17505214c0827a30 (diff)
Core/Random: Remove no longer needed hack for VS 2013
Diffstat (limited to 'src')
-rw-r--r--src/common/Utilities/Containers.h4
-rw-r--r--src/common/Utilities/Random.h22
2 files changed, 1 insertions, 25 deletions
diff --git a/src/common/Utilities/Containers.h b/src/common/Utilities/Containers.h
index 5edb245fd87..33c4fea2c8f 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 <algorithm>
#include <functional>
#include <list>
@@ -84,8 +83,7 @@ namespace Trinity
template <class C>
typename C::const_iterator SelectRandomWeightedContainerElement(C const& container, std::vector<double> weights)
{
- Trinity::discrete_distribution_param<uint32> ddParam(weights.begin(), weights.end());
- std::discrete_distribution<uint32> dd(ddParam);
+ std::discrete_distribution<uint32> 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 cf3c1602adf..2cd25e41dc9 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<typename T>
- struct discrete_distribution_param : public std::discrete_distribution<T>::param_type
- {
- typedef typename std::discrete_distribution<T>::param_type base;
-
- template<typename InIt>
- discrete_distribution_param(InIt begin, InIt end) : base(_Noinit())
- {
- this->_Pvec.assign(begin, end);
- this->_Init();
- }
- };
-#else
- template<typename T>
- using discrete_distribution_param = typename std::discrete_distribution<T>::param_type;
-#endif
-}
-
#endif // Random_h__