3 ms·
Yeah but the problem is that your benefits depend on the libraries you're using. You might not be able to use unique/shared_ptr because of some framework using
by seivan 11y ago
Yeah but the problem is that your benefits depend on the libraries you're using. You might not be able to use unique/shared_ptr because of some framework using different conventions internally.
But overall, I agree with you. C++11 seems different from when we used it in high school.
- KayEss 11y agoThat's true to a certain extent. There are a ton of new libraries appearing though, and the benefits of moving to the newer features are so compelling that actively maintained libraries are swiftly moving over. In the past six months I've moved all of mine from C++03 to C++14 and going through the process of stripping out loads of Boost and internal facilities that are now in the language.
- T-zex 11y agoSmart pointers are about ownership. If "some framework is using different conventions internally" then that framework entirely owns the resource and access to it is not managed by smart pointers. That is a natural, fully idiomatic behaviour of modern C++ and is not related to any specific library.
- seivan 11y agoyeah I am familiar with ownership from Obj-C reference counting. But the problem is when your own code interacts with the framework that uses its own internal way of managing memory (ironically it's a copy of Obj-C reference counting) Right now I've decided just to go with the frameworks way of doing things and inherit from their base object. The problem comes when I want to use this code outside in a different project :-/