For the std::unique_ptr the deleter is part of the type and the std::shared_ptr keeps it as part of its control
Continue readingCategory: Pointer
Position of Ptr. / Ref. (C++)
There are two common ways for the position of the pointer sign (*) or the reference sign (&). C-Style ClassA
Continue readingWhen and how to pass smart pointer (C++)
This post is based on a post from Herb Sutter. When if (The ownership of the object isn’t shared or
Continue readingLayout of std::shared_ptr (libstdc++)
Source code Debugging Visual result |———————-| | shared_ptr sPtr1 | |———————-| |Pointer to the Object |—|——-> Object | | |
Continue readingDoes Java have pointers?
Most guys would say “No, but C++ has pointers” and they are right, but not in the way they assume
Continue readingCyclic references (C++)
Problem The following code shows the problem of a cyclic reference with shared pointers. When leaving the main function the
Continue readingSmart Pointer (C++)
Especially in older C++ programms it was very common to work with a lot of raw pointer (legacy pointer). That
Continue reading