I have been using C ++ for a long time and I know very well about caution when allocating and freeing memory, especially not forgetting to delete unused instances.
Now, I just recently used boost and with the problem I am facing, I am forced to use smart pointers (in particular, shared_ptr). So, if I am going to use shared_ptr for this problem, should I use smart pointers to my entire normal code base of pointers?
. . - .
, ( ). , , .
, . , ::boost::shared_ptr . , shared_ptr .
::boost::shared_ptr
shared_ptr
shared_ptr, ::std::auto_ptr , ++ 0x ::std::unique_ptr. , .
::std::auto_ptr
::std::unique_ptr
, . .
, , . , .
, , , . , C, , , free . , , realloc, ::std::vector - .
free
realloc
::std::vector
, , ( ::boost::shared_ptr ( ++ 0x ::std::shared_ptr)) .
::std::shared_ptr
. Boost , . , , /, , . (, ) .
scoped_ptr , . , // , . , . , , - , - NULL if.
, . new:
new
???
, . " , , shared_pointer!"
: ?, , .
. , .