Boost logo

Boost :

From: Thorsten Ottosen (nesotto_at_[hidden])
Date: 2004-04-20 19:58:39


"michael toksvig" <michaeltoksvig_at_[hidden]> wrote in message
news:c63fk0$ko0$1_at_sea.gmane.org...

| Versus the rather redundant:
| for (list<double>::iterator i = container.begin(); i
!=container.end();
| ++i)
| *i += 2;
|
| (Note that the latter stops working if container is represented using a
| vector or a built-in array instead)

not with some collection traits:

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

br

Thorsten


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