Update <random> with constexpr support. Patch contributed by Jonathan Sauer.
llvm-svn: 153896
diff --git a/libcxx/include/algorithm b/libcxx/include/algorithm
index 68e989a..d924a7d 100644
--- a/libcxx/include/algorithm
+++ b/libcxx/include/algorithm
@@ -2508,11 +2508,16 @@
_Engine_result_type __mask0_;
_Engine_result_type __mask1_;
+#ifdef _LIBCPP_HAS_NO_CONSTEXPR
static const _Working_result_type _Rp = _Engine::_Max - _Engine::_Min
- + _Working_result_type(1);
- static const size_t __m = __log2<_Working_result_type, _Rp>::value;
- static const size_t _WDt = numeric_limits<_Working_result_type>::digits;
- static const size_t _EDt = numeric_limits<_Engine_result_type>::digits;
+ + _Working_result_type(1);
+#else
+ static _LIBCPP_CONSTEXPR const _Working_result_type _Rp = _Engine::max() - _Engine::min()
+ + _Working_result_type(1);
+#endif
+ static _LIBCPP_CONSTEXPR const size_t __m = __log2<_Working_result_type, _Rp>::value;
+ static _LIBCPP_CONSTEXPR const size_t _WDt = numeric_limits<_Working_result_type>::digits;
+ static _LIBCPP_CONSTEXPR const size_t _EDt = numeric_limits<_Engine_result_type>::digits;
public:
// constructors and seeding functions