std::ctype<CharT>::~ctype

来自cppreference.com
< cpp‎ | locale‎ | ctype

 
 
本地化库
本地环境与平面
本地环境
平面类别基类
ctype(字符类别)平面
numeric(数值)平面
collate(对照比较)平面
time(时间)平面
monetary(货币)平面
messages(消息)平面
字符分类与转换
字符分类
转换
编码转换平面
(C++11)    
C 本地环境
 
 
在标头 <locale> 定义
protected: ~ctype();

析构 std::ctype 平面。此析构函数为受保护且为虚(由于基类析构函数为虚)。 std::ctype 类型对象,同大多数平面,只能在最后一个实装此平面的 std::locale 离开作用域时,或若用户定义导出自 std::ctype 并实现公开构造函数,才会被销毁。

示例

#include <iostream>
#include <locale>
struct Destructible_ctype : public std::ctype<wchar_t>
{
    Destructible_ctype(std::size_t refs = 0) : ctype(refs) {}
    // 注意:隐式析构函数为公开
};
int main()
{
    Destructible_ctype dc;
    // std::ctype<wchar_t> c;  // 编译错误:受保护析构函数
}