llvm.org GIT mirror llvm / ef6860f
[RandomNumberGenerator] Remove MSVC 2013 compatibility hack. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286083 91177308-0d34-0410-b5e6-96231b3b80d8 Davide Italiano 4 years ago
1 changed file(s) with 2 addition(s) and 12 deletion(s). Raw diff Collapse all Expand all
4343 /// Returns a random number in the range [0, Max).
4444 result_type operator()();
4545
46 // We can only make min/max constexpr if generator_type::min/max are
47 // constexpr. The MSVC 2013 STL does not make these constexpr, so we have to
48 // avoid declaring them as constexpr even if the compiler, like clang-cl,
49 // supports it.
50 #if defined(_MSC_VER) && _MSC_VER < 1900
51 #define STL_CONSTEXPR
52 #else
53 #define STL_CONSTEXPR constexpr
54 #endif
55
56 static STL_CONSTEXPR result_type min() { return generator_type::min(); }
57 static STL_CONSTEXPR result_type max() { return generator_type::max(); }
46 static constexpr result_type min() { return generator_type::min(); }
47 static constexpr result_type max() { return generator_type::max(); }
5848
5949 private:
6050 /// Seeds and salts the underlying RNG engine.