Quantcast
Channel: Visual C forum
Viewing all articles
Browse latest Browse all 15302

Comparing boost::scoped_ptr and std::auto_ptr

$
0
0

Hi , i was doing a little reading on scoped pointers and i came to aline which stated

"Since a scoped pointer simply stores and solely owns an address, the implementation ofboost::scoped_ptr is less complex than std::auto_ptr. boost::scoped_ptr should be preferred if transfer of ownership is not required. In these situations, it may be a better choice thanstd::auto_ptr to avoid inadvertent transfer of ownership."

Now what does transfer of ownership mean ?? Could anyone give an example of what transfer of ownership means ??

and i also came along scoped boost scoped array whats the difference between Scoped Array and boost scoped Pointer.

What i know is that boost scoped array is merely used as a pointer to store the address of Arrays that we have created.. 

A little bit of background and more information would be helpful..


A candle loses nothing by lighting another candle.

Viewing all articles
Browse latest Browse all 15302

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>