Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2004-04-21 10:00:03


Alexander Nasonov <alnsn-mycop_at_[hidden]> writes:

> David Abrahams wrote:
>
>> John Torjo <john.lists_at_[hidden]> writes:
>>
>>>> You can also use the rtl (Ranges Template Library):
>>>> (note: I'll rename the library, wince there's another one with the
>>>> same name ;))
>>>>
>>>> for( crange<container> r(cont); r; ++r)
>>>> *r += 2;
>>>>
>>> p.s. no macros involved in the above statement ;)
>>> Best,
>>> John
>>
>> That said, you do have have to name the container type. At the same
>> time, you don't have to name the element type ;-)
>> You could get rid of the container type if you recall any_pointer
>> idea.

I have in fact used such an any_container. Of course, then you're be
back to naming the value_type ;-)

-- 
Dave Abrahams
Boost Consulting
http://www.boost-consulting.com

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