Boost logo

Boost :

Subject: Re: [boost] [Review:Algorithms] Order of args to clamp
From: Marshall Clow (mclow.lists_at_[hidden])
Date: 2011-09-26 14:18:20


On Sep 26, 2011, at 11:02 AM, Steven Watanabe wrote:

> AMDG
>
> On 09/26/2011 10:40 AM, Marshall Clow wrote:
>> On Sep 26, 2011, at 9:33 AM, Dave Abrahams wrote:
>>
>>> 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)
>>
>>
>> BTW, clamp_range defined like this fails on the following code:
>>
>> int inputs [] = { 0, 1, 2, 3, 4 };
>> clamp_range ( &inputs[0], &inputs[5], 2, 4 );
>>
>> because pointers are not iterators.
>
> Yes they are.
>

I typed InputIterator::value_type instead of itertor_traits<Iter>::value_type.

Pilot error.
Sorry for the noise.

-- Marshall

Marshall Clow Idio Software <mailto:mclow.lists_at_[hidden]>

A.D. 1517: Martin Luther nails his 95 Theses to the church door and is promptly moderated down to (-1, Flamebait).
        -- Yu Suzuki


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