Boost logo

Boost :

Subject: Re: [boost] [Review:Algorithms] Order of args to clamp
From: TONGARI (tongari95_at_[hidden])
Date: 2011-09-26 14:17:03


2011/9/27 Peter Dimov <pdimov_at_[hidden]>

> Dave Abrahams wrote:
>
> IMO it clearly should be:
>>
>> template<typename Iter>
>> void clamp_range(
>> Iter first, Iter last, typename itertor_traits<Iter>::value_**type
>> const& high, typename itertor_traits<Iter>::value_**type const& low)
>>
>
> Then clamp should be
>
> template<class T> T clamp( T const & value,
> typename identity<T>::type const & low,
> typename identity<T>::type const & high );

I second this. BTW, The return type could be T const&.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk