Boost logo

Boost :

From: Thorsten Ottosen (thorsten.ottosen_at_[hidden])
Date: 2008-01-02 07:19:41


Phil Endecott skrev:
> Herve Bronnimann wrote:
>> Phil: Pardon my ignorance about ptr_vector, but you may be thinking
>> about the wrong STL algorithm: try rotate instead of copy:
>
> Yes, rotate would do something similar to the for loop in my example.
>
> The point is that ptr_containers can't use mutating std::algorithms;
> instead, they provide their own implementations of some of them as
> members. rotate isn't one of them, so I need some other way of doing it.

You can access mutating iterators over the original containers by
calling .base() no the iterators.

They are hen iterators over void*&, so you need to cast or use e.g.
void_ptr_indirect_fun:

http://www.boost.org/libs/ptr_container/doc/indirect_fun.html

-Thorsten


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