Hello,

>> It would be possible, of course, to conditionally define those constants to 
>> either use min() and max()
>> or _Min and _Max, respectively:
>> 
>> #if _LIBCPP_HAS_NO_CONSTEXPR
>>   static const result_type _Min = _Engine::_Min;
>>   static const result_type _Max = _Engine::_Max;
>> #else
>>   static _LIBCPP_CONSTEXPR const result_type _Min = _Engine::min();
>>   static _LIBCPP_CONSTEXPR const result_type _Max = _Engine::max();
>> #endif
>> 
>> But this would depend on the non-standard members _Min and _Max. And it 
>> would complicate the source, too.
>> 
>> What do you think?
> 
> This looks like the way to go to me.  I count 3 places in <random> and 1 
> place in <algorithm> that need this treatment.  User-written engines will 
> either have to -std=c++11, or provide the non-standard interface.  I don't 
> see another way around this.

I have changed <random> and <algorithm> accordingly and attached the new patch. 
numerics/rand tests pass
in C++03 and C++11 mode (except for the tests involving initializer_list).


Jonathan

Attachment: random.diff
Description: Binary data


_______________________________________________
cfe-commits mailing list
cfe-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to