An abstract data type that simulates a pointer while providing additional features, such as automatic garbage collection or bounds checking
I have been learning managed pointers lately and ran into the following scenario. I am implementing a model/controller class …
c++ heap-memory smart-pointers stack-memoryI recently watched a great talk by Herb Sutter about "Leak Free C++..." at CppCon 2016 where he talked about using …
c++ memory-leaks garbage-collection smart-pointersTo solve a very peculiar problem in my application I need a shared-pointer to allocated data, but to the outside …
c++ visual-c++ c++11 shared-ptr smart-pointersRaw pointers can point to objects allocated on the stack or on the heap. Heap allocation example: // heap allocation int* …
c++11 pointers smart-pointers heap-memory unique-ptrThis is a bit of a two part question, all about the atomicity of std::shared_ptr: 1. As far as …
c++ c++11 smart-pointersFor example - #include <memory> int main(){ const auto bufSize = 1024; auto buffer = std::make_unique<char[]>(…
c++ c++11 memory c++14 smart-pointersWhat exactly is the point of the construct std::observer_ptr in the library fundamentals technical specification V2? It seems …
c++ smart-pointers c++17I've been working with pointers for a few years now, but I only very recently decided to transition over to …
c++ pointers c++11 smart-pointersI'm using enable_shared_from_this<Base> and then inherit from Base. When trying to use shared_from_…
c++ boost c++11 shared-ptr smart-pointersI was not expecting this code to compile: #include <iostream> #include <memory> class A { public: inline …
c++ pointers smart-pointers const-correctness object-composition