Boost logo

Boost :

From: Thorsten Ottosen (nesotto_at_[hidden])
Date: 2003-12-23 18:43:47

"Peter Dimov" <pdimov_at_[hidden]> wrote in message
> If you want to demonstrate reuse you need a better example than
> for_each( svec.begin(), svec.end(), mem_fn(&Poly::foo) );
> for_each( pvec.begin(), pvec.end(), mem_fn(&Poly::foo) );

he he :-) yes, I already stated that the example could be better. Reuse of
functors might be there, but it depends a bit on your needs.
What the example do show is the differnce in declaration and how you would
use push_back. If you have an iterator, you would
see the difference as

vector<Foo*>::iterator i = ..;
ptr_vector<Foo>::iterator ii = ..;

**i = Foo();
*ii = Foo();



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