* Lars Gullik Bjønnes <[EMAIL PROTECTED]> [010528 22:33]:
>
> you are mixing scoped_ptr and shared_ptr.
I've though of shared_ptr as the no-ownership and smart_ptr as the
reference counted one. Obviously I was wrong with the names.
--
Baruch Even
http://baruch.ev-en.org/
Andre Poenitz <[EMAIL PROTECTED]> writes:
| > Probably shared_ptr, _but_ that depend on how the copy contructor is
| > supposed to work. Should the new object have a pointer to the same
| > object that the first class points too? If you need a deep copy you
| > have to write the copy con, copy as
> Probably shared_ptr, _but_ that depend on how the copy contructor is
> supposed to work. Should the new object have a pointer to the same
> object that the first class points too? If you need a deep copy you
> have to write the copy con, copy assign. manually.
Grmpf... Yes. I want deep copies.
Andre Poenitz <[EMAIL PROTECTED]> writes:
| I do not need to pass such things to functions a copy.
|
| So what would I use?
Probably shared_ptr, _but_ that depend on how the copy contructor is
supposed to work. Should the new object have a pointer to the same
object that the first class points
Baruch Even <[EMAIL PROTECTED]> writes:
| * Andre Poenitz <[EMAIL PROTECTED]> [010528 09:46]:
| >
| > Is there some way to get "simple" smart_pointers (i.e. the copy/destuction
| > behaviour of shared_pointer without the reference counting)?
|
| Yes and No. There is in the C++ standard a templa
> shared_ptr has no ownership, it keeps the pointer, copies the pointer on
> assignment and the first shared_ptr to die, kills the pointer it keeps
> with it. Ofcourse if you know where the pointer should not die, you can
> use .reset(0) to say so.
Uhuh... I knew I did something wrong... This wil
* Andre Poenitz <[EMAIL PROTECTED]> [010528 09:46]:
>
> Is there some way to get "simple" smart_pointers (i.e. the copy/destuction
> behaviour of shared_pointer without the reference counting)?
Yes and No. There is in the C++ standard a template for auto_ptr which
is a smarter shared_ptr.
For t
Is there some way to get "simple" smart_pointers (i.e. the copy/destuction
behaviour of shared_pointer without the reference counting)?
It looks as though it hit me again...
Andre'
--
André Pönitz . [EMAIL PROTECTED]