What makes you think auto_ptrslower than shared_ptr? Normally, I would expect the opposite to be true, since shared_ptrit is necessary to update the reference count.
According to what you should use, different smart pointers imply different semantics of ownership. Ownership implies responsibility for the removal of an object when it is no longer needed.
- A raw pointer implies a lack of ownership ; a program that correctly uses smart pointers can still use raw pointers in many places where the property is not intended (for example, if you need to pass an optional object reference to a function, you will often use a raw pointer).
scoped_ptr (.. ), .auto_ptr (.. ) . , , ( ). auto_ptr - , - , auto_ptr , ( , ).unique_ptr , auto_ptr, ++ 0x ( rvalue), ( ), auto_ptr. , unique_ptr , auto_ptr.shared_ptr . -, . , .
, shared_ptr STL, (- ). shared_ptr, . ( ) - boost (ptr_vector, ptr_map ..), ( ) , ( ) ) .
: , , , . , , , .
[, unique_ptr]