Quantcast
Channel: Disadvantages of shared_ptr - Stack Overflow
Browsing all 4 articles
Browse latest View live

Answer by Walter for Disadvantages of shared_ptr

If performance is important I would not use std::shared_ptr. For example, to sort an array with real pointers is 5 times faster than to sort with shared pointers.On the other hand shared pointer do not...

View Article



Answer by Jiří Pospíšil for Disadvantages of shared_ptr

One other thing worth mentioning is that you need to be very careful when designing your APIs with std::shared_ptr. The obvious advantage over a raw pointer is the automatic memory management (with the...

View Article

Answer by cdhowie for Disadvantages of shared_ptr

Of course there are disadvantages: you require extra memory to maintain a reference count, and every time you copy or destroy a shared_ptr instance this reference count has to be incremented and...

View Article

Disadvantages of shared_ptr

With shared_ptr included in c++11, one could achieve a semi garbage-collected enviroment. Does the (inflationary?) usage come along with some disadvantages?I could imagine a class model, where you...

View Article
Browsing all 4 articles
Browse latest View live




Latest Images

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