Boost logo

Boost :

From: Eric Niebler (eric_at_[hidden])
Date: 2004-04-21 10:04:15


Thorsten Ottosen wrote:

> with some collection traits:
>
> for( iterator_of< T >::type i = begin( c ); i != end( c ); ++i )
> *i +=2;
>

This is better than a standard for-loop from a maintenance perspective,
but not from a usability perspective. It's just as much typing, or more.
You still have to specify the container type. And if the container type
is dependent, you'll need to insert a "typename" before iterator_of< T
>::type. It also requires you to have an understanding of iterators and
half-open sequences, something that is not intuitive to people new to
the STL way.

-- 
Eric Niebler
Boost Consulting
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