std::numpunct::~numpunct(3)
πΈ NAME πΈ
std::numpunct::~numpunct β thatβs the name, bestie: std::numpunct::~numpunct. This page comes from the C++ Standard Libary manual (yes, βLibaryβ exactly like the header says β keeping it π―).
π¦ Synopsis π¦
Defined in header <locale>:
protected: ~numpunct();
Okay so this destructor destructs a std::numpunct facet. Itβs protected and virtual β virtual because the base class destructor is virtual, iykyk. An object of type std::numpunct, like most facets, can only be destroyed when the last std::locale object that implements this facet goes out of scope, or if a user-defined class is derived from std::numpunct and implements a public destructor. Thatβs the whole vibe, no cap π
.
π Example π
// Run this code
#include <iostream>
#include <locale>
struct Destructible_numpunct : public std::numpunct<wchar_t>
{
Destructible_numpunct(std::size_t refs = 0) : numpunct(refs) {}
// note: the implicit destructor is public
};
int main()
{
Destructible_numpunct dc;
// std::numpunct<wchar_t> c; // compile error: protected destructor
}
Source/version and date, for the record: http://cppreference.com Β· 2024.06.10 Β· std::numpunct::~numpunct(3) β bye bestie, go forth and destruct responsibly π«Άβ¨π
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms