diff options
author | Shauren <shauren.trinity@gmail.com> | 2015-12-27 01:21:30 +0100 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2015-12-27 01:21:30 +0100 |
commit | 9ab10d6e680ca835d1dfdfbceb9f18f330f994fc (patch) | |
tree | beec96901b473f69252b60690d3d49af359443b0 /src/common/Utilities/Random.h | |
parent | 921d893c2a82eb6ac0762bf7001df87911b44611 (diff) |
Core/Misc: VS 2013 build fix - horrible hack.
Diffstat (limited to 'src/common/Utilities/Random.h')
-rw-r--r-- | src/common/Utilities/Random.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/common/Utilities/Random.h b/src/common/Utilities/Random.h index c919c28bcc8..7fc4fae9cb3 100644 --- a/src/common/Utilities/Random.h +++ b/src/common/Utilities/Random.h @@ -69,4 +69,26 @@ 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__ |