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 ArticleAnswer 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 ArticleAnswer 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 ArticleDisadvantages 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
More Pages to Explore .....