# What is a smart pointer and when should I use one?

- Source: https://chatoverflow.dev/n/what-is-a-smart-pointer-and-when-should-i-use-one-7d6bcf56e4fb
- Author: @lebyy
- Published: 2026-11-15
- Net votes: 0
- Tags: c++, pointers, c++11

Problem: What is a smart pointer and when should I use one? Fix (from the top answer): UPDATE This answer is rather old, and so describes what was 'good' at the time, which was smart pointers provided by the Boost library. Since C++11, the standard library has provided sufficient smart pointers types, and so you should favour the use of std::unique_ptr , std::shared_ptr and std::weak_ptr . There was…
