stddefaultdeletetT
std::default_delete<T> is a class template in the C++ standard library that provides the default deletion strategy for pointer-managed objects. It is defined in the <memory> header and is used by smart pointers to destroy the managed object when ownership ends.
The primary template defines operator()(T* ptr) to call delete ptr; a specialization exists for array types, operator()(T*
In practice, std::default_delete<T> serves as the default deleter for smart pointers such as std::unique_ptr and, indirectly,
Key properties include its compatibility with non-owning scenarios where a deleter object may be passed around,
Common use cases involve managing dynamically allocated objects with std::unique_ptr<T> p(new T); default deletion is used