|
Boost Users : |
From: David Grüner (David.Gruener_at_[hidden])
Date: 2006-12-08 13:59:59
Hello,
i need to give up the ownership of a ptr_container (vector here)
over its pointers (without assignment to a new ptr_container).
Two questions here:
1. Do i really have to write aPtrContainer.release().release()?
It looks weird. For me, the function name release() of the container
seems confusing since an unassigned aPtrContainer.release() just
does the "opposite" of auto_ptr<T>::release(), namely deleting the
pointers. ;o) The behavior is more like transfer_ownership()
or something similar ($0.02).
2. Beside managing memory, i plan to use ptr_container primarily to
propagate const. So, in some cases i need a ptr_container which just
doesn't own any given memory. What's the best way to do that?
Any comments or pointers to missed docs are welcome.
David
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net