STD::DEFAULT_DELETE(3cxx)
π std::default_delete< _Tp > π
okay so bestie, welcome to the std::default_delete< _Tp > page β this is the libstdc++ manpage for it, and we're gonna get you comfy with it, no cap π«Ά
β¨ SYNOPSIS β¨
First things first, you gotta pull it in:
#include <memory>
π Public Member Functions
constexpr default_delete () noexcept=defaultβ the default constructor. yes queen, it's just sitting there being defaulted β¨ (described below as "Default constructor.")template<typename _Up , typename = _Require<is_convertible<_Up*, _Tp*>>> constexpr default_delete (const default_delete< _Up > &) noexceptβ the converting constructor. it lets you convert from a deleter made for another type (_Up) but only if_Up*is convertible to_Tp*β the_Requireis doing the gatekeeping π (described below as "Converting constructor.")constexpr void operator() (_Tp *__ptr) constβ callsdelete __ptr, that's literally the whole job. iconic.
πΈ Detailed Description πΈ
template<typename _Tp>
struct std::default_delete< _Tp >
it's giving "Primary template of default_delete, used by unique_ptr for single objects" π like, this is the little guy that unique_ptr uses under the hood for single objects. main character energy fr fr π
β Since
C++11
(the way this is old enough to be a classic but still slays π)
π Constructor & Destructor Documentation π
π¦ template<typename _Tp > constexpr std::default_delete< _Tp >::default_delete () [constexpr], [default], [noexcept]
Default constructor. that's it. that's the whole thing. it's constexpr, it's default, it's noexcept β a triple threat, we love to see it β¨
π¦ template<typename _Tp > template<typename _Up , typename = _Require<is_convertible<_Up*, _Tp*>>> constexpr std::default_delete< _Tp >::default_delete (const default_delete< _Up > &) [inline], [constexpr], [noexcept]
Converting constructor. bestie read carefully: it "Allows conversion from a deleter for objects of another type, _Up, only if _Up* is convertible to _Tp*." so like, it's not free-for-all conversion, the types gotta actually be compatible or it just won't let you in π note the [inline], [constexpr] and [noexcept] β yes all three, she's versatile π
π₯ Member Function Documentation π₯
π template<typename _Tp > constexpr void std::default_delete< _Tp >::operator() (_Tp * __ptr) const [inline], [constexpr]
Calls delete __ptr
that's the vibe. you hand it __ptr, it deletes it. [inline] and [constexpr] on deck. periodt π
π Author π
Generated automatically by Doxygen for libstdc++ from the source code. (so like, a robot wrote this, not me, don't come for me π)
π that's the whole page bestie β no extra lore, no hidden flags, just the deleter doing its deleter thing. iykyk π§
and that's a wrap on this libstdc++ page for std::default_delete< _Tp >(3cxx) π thanks for reading babe, go delete some pointers (responsibly) πβ¨
π¦ where this page comes from
- ubuntu noble: libstdc++-14-doc 14-20240412-0ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms