Update <random> with constexpr support. Patch contributed by Jonathan Sauer.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@153896 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -30,12 +30,14 @@ private:
|
||||
static_assert(Min < Max, "rand1 invalid parameters");
|
||||
public:
|
||||
|
||||
// Temporary work around for lack of constexpr
|
||||
#ifdef _LIBCPP_HAS_NO_CONSTEXPR
|
||||
// Workaround for lack of constexpr in C++03
|
||||
static const result_type _Min = Min;
|
||||
static const result_type _Max = Max;
|
||||
#endif
|
||||
|
||||
static const/*expr*/ result_type min() {return Min;}
|
||||
static const/*expr*/ result_type max() {return Max;}
|
||||
static _LIBCPP_CONSTEXPR result_type min() {return Min;}
|
||||
static _LIBCPP_CONSTEXPR result_type max() {return Max;}
|
||||
|
||||
explicit rand1(result_type sd = Min) : x_(sd)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user