std::locale::operator==, operator!=

< cpp‎ | locale‎ | locale
在标头 <locale> 定义
bool operator==( const locale& other ) const;
(1)
bool operator!=( const locale& other ) const;
(2) (C++20 前)

测试两个本地环境的相等性。若具名本地环境的名称相等则认为它们相等。若无名本地环境互为彼此的副本则认为它们相等。

!= 运算符从 operator== 运算符合成

(C++20 起)

参数

other - 要比较的 std::locale 对象

返回值

1)other*this 的副本或拥有等同名称则为 true,否则为 false
2)other*this 的副本或拥有等同名称则为 false,否则为 true

示例

参阅

构造新的本地环境
(公开成员函数)
返回本地环境的名称,或若它无名则为 "*"
(公开成员函数)