Boost logo

Boost :

From: Christian Engström (christian.engstrom_at_[hidden])
Date: 2004-02-27 15:52:43

>Yitzhak Sapir wrote:
> You could define a container adaptor that takes a container, and modifies the begin()/end() iterators to return indirect iterators to the original begin()/end(). Then instead of:
> typedef some_container container_type;
> you would have:
> typedef adaptor<some_container> container_type;
Yes, that was in fact what I was originally hoping for, but the best I
could manage for the general case was

   proxy_container< some_container< proxy<T> > >

Still one line though, even if its an uglier line than I'd prefer. :-)

> You might want to read "Beware the Illusion of container-independent code", by Scott Meyers in his book:
Good point, it's good to remember that the (partial) symmetry between
the STL containers manages to be useful despite some really quite major
restrictions and caveats, including some that may cause the program to
fail silently and intermittently --- *shudder*!

But even so, ...

Boost list run by bdawes at, gregod at, cpdaniel at, john at