Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/llvm/llvm-project.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHoward Hinnant <hhinnant@apple.com>2012-04-03 01:00:45 +0400
committerHoward Hinnant <hhinnant@apple.com>2012-04-03 01:00:45 +0400
commite386b7b360d6508f974db64d43d13129e36e2b22 (patch)
treec3d32fbea80d078764ae59bcd575ab7179aa061d /libcxx/include/algorithm
parent9b7efd5bb617fae759c9ebe7fb4f72c989027fd8 (diff)
Update <random> with constexpr support. Patch contributed by Jonathan Sauer.
llvm-svn: 153896
Diffstat (limited to 'libcxx/include/algorithm')
-rw-r--r--libcxx/include/algorithm13
1 files changed, 9 insertions, 4 deletions
diff --git a/libcxx/include/algorithm b/libcxx/include/algorithm
index 68e989a0be1e..d924a7de3f2d 100644
--- a/libcxx/include/algorithm
+++ b/libcxx/include/algorithm
@@ -2508,11 +2508,16 @@ private:
_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