Subject: Re: [boost] temp_ptr<> - preventing use as a member
From: Pierre Morcello (pmorcell-cppfrance_at_[hidden])
Date: 2011-11-29 13:29:18
Gottlob Frege wrote:
> And thoughts on the goal of specific smart pointers for all occasions?
It happens in some of my projects : I use a kind of std::auto_ptr whenever I
need to transmit an aggregation (typically a factory creates an element and
returns such auto_ptr). Every raw ptr means 'simple handle'. shared_ptr are
used only for aggregation in multithread environment. (This obviously does
not cover all your need).
My feelings now are that if you put smart pointers everywhere, this could be
a little cumbersome to write and read. Use at least raw pointer to represent
one of the cases of lifetime duration/use. When you got some very special
usage, you might also use some kind of hungarian notation just for that
case. That way the whole thing might need a fewer kinds of smart_ptr.
This is just my point of view. Thank you for the temp_ptr idea.
-- View this message in context: http://boost.2283326.n4.nabble.com/temp-ptr-preventing-use-as-a-member-tp4037942p4120241.html Sent from the Boost - Dev mailing list archive at Nabble.com.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk