
2 Jan
2008
2 Jan
'08
12:19 p.m.
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