Smart Pointers (C++)

Smart pointers are very useful feature of modern C++ programming model. They are defined in the std namespace in the <memory> header file. Let’s see the raw and smart pointer in action: [crayon-594c0a2152f73096102850/] As we can see there is a clear advantage of using smart pointers instead of the raw ones. The standard library provide three smart pointer types which should be replacement for raw pointers as long as new code is developed: unique_ptr allows one and only one owner

Continue Reading

Site Footer