How to exclude pointer from boost::ptr_vector without his deletion? =)
views:
55answers:
1
+4
A:
ptr_vector<A> v;
v.push_back(new A);
A *temp=v.release(v.begin()).release();
At this point you own the object exclusively through temp
. If you don't need it, use this instead:
v.release(v.begin());
[code credit: see here]
Steve Townsend
2010-10-14 16:23:59