llvm.org GIT mirror llvm / 47b7d1a
Fix the stage2 MSVC 2013 build with less constexpr in RNG git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283954 91177308-0d34-0410-b5e6-96231b3b80d8 Reid Kleckner 4 years ago
1 changed file(s) with 13 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
4242
4343 /// Returns a random number in the range [0, Max).
4444 result_type operator()();
45 static LLVM_CONSTEXPR result_type min() { return generator_type::min(); }
46 static LLVM_CONSTEXPR result_type max() { return generator_type::max(); }
45
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 LLVM_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(); }
4758
4859 private:
4960 /// Seeds and salts the underlying RNG engine.