Цитата(Litkevich Yuriy @ 5.5.2008, 10:31)
может у него другое название есть?
чем он от обычного указателя отличается?
Обычно его называют smart pointer
http://en.wikipedia.org/wiki/Smart_pointerIn computer science, a smart pointer is an abstract data type that simulates a pointer while providing additional features, such as automatic garbage collection or bounds checking. These additional features are intended to reduce bugs caused by the misuse of pointers while retaining efficiency. Smart pointers typically keep track of the objects that point to them for the purpose of memory management.
Грубо говоря, если ты например выделяешь память под объект в каком то одном месте, то ты должен отследить и все места, где его надо удалить да? А если возникнет ошибка, где то ты не там вывалишься... неплохо бы, чтобы объект удалился. Ну это если упрощать. Вообще это относится к концепции RAII (Resource Acquisition Is Initialization)
http://en.wikipedia.org/wiki/Resource_Acqu..._InitializationТипичные представители smart pointers -
auto_ptr из стандартной библиотеки и набор из boost
http://www.boost.org/doc/libs/1_35_0/libs/...r/smart_ptr.htm