std::moneypunct<CharT,International>:: ~moneypunct
From cppreference.net
<
cpp
|
locale
|
moneypunct
C++
Text processing library
| Localization library | |||||||||||||||||||||||||
| Regular expressions library (C++11) | |||||||||||||||||||||||||
| Formatting library (C++20) | |||||||||||||||||||||||||
| Null-terminated sequence utilities | |||||||||||||||||||||||||
| Byte strings | |||||||||||||||||||||||||
| Multibyte strings | |||||||||||||||||||||||||
| Wide strings | |||||||||||||||||||||||||
| Primitive numeric conversions | |||||||||||||||||||||||||
|
|||||||||||||||||||||||||
| Text encoding identifications | |||||||||||||||||||||||||
|
|||||||||||||||||||||||||
Localization library
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
std::moneypunct
| Member functions | ||||
|
moneypunct::~moneypunct
|
||||
|
定义于头文件
<locale>
|
||
|
protected
:
~moneypunct
(
)
;
|
||
析构 std:: moneypunct facet。此析构函数受保护且为虚函数(因其 基类 析构函数为虚函数)。与大多数facet类似, std:: moneypunct 类型的对象仅当最后一个实现该facet的 std::locale 对象离开作用域时,或用户自定义类继承自 std:: moneypunct 并实现了公共析构函数时才能被销毁。
示例
运行此代码
#include <iostream> #include <locale> struct Destructible_moneypunct : public std::moneypunct<wchar_t> { Destructible_moneypunct(std::size_t refs = 0) : moneypunct(refs) {} // 注意:隐式析构函数是公开的 }; int main() { Destructible_moneypunct dc; // std::moneypunct<wchar_t> c; // 编译错误:受保护的析构函数 }