在线文档教程
C++
本土化 | Localizations

std::collate_byname

STD:校对[医]名名

Defined in header
template< class CharT > class collate_byname : public std::collate<CharT>;

std::collate_bynamestd::collate方面,它封装了特定于地区的排序规则%28比较%29和字符串的散列。就像std::collate,它可以被注入std::regex并适用于,通过...std::locale::operator(),直接指向所有期望字符串比较谓词的标准算法。

标准库提供了两个专门化。

在标头中定义<locale>

*。

STD:校对[医]名名<char>特定于地区的多字节字符串排序规则

STD:校对[医]名<wchar[医]T>特定于区域设置的宽字符串排序规则

成员函数

(constructor)constructs a new collate_byname facet (public member function)
(destructor)destroys a collate_byname facet (protected member function)

STD:校对[医]名称::[医]名名

explicit collate_byname( const char* name, std::size_t refs = 0
explicit collate_byname( const std::string& name, std::size_t refs = 0 (since C++11)

构造一个新的std::collate_byname区域设置的方面name...

refs用于资源管理:如果refs == 0时,该实现破坏了面。std::locale保存它的对象被销毁。否则,该对象不会被销毁。

参数

name-the name of the locale
refs-the number of references that link to the facet

STD:校对[医]名称::~校对[医]名名

protected: ~collate_byname(

摧毁了这个面。

继承自STD:校对

成员类型

Member typeDefinition
char_typecharT
string_typestd::basic_string<charT>

成员函数

compareinvokes do_compare (public member function of std::collate)
transforminvokes do_transform (public member function of std::collate)
hashinvokes do_hash (public member function of std::collate)

受保护成员函数

do_compare virtualcompares two strings using this facet's collation rules (virtual protected member function of std::collate)
do_transform virtualtransforms a string so that collation can be replaced by comparison (virtual protected member function of std::collate)
do_hash virtualgenerates an integer hash value using this facet's collation rules (virtual protected member function of std::collate)

注记

排序顺序是字典顺序:字母在国家字母中的位置等价类%29比它的情况或变体有更高的优先级。在等价类中,小写字符在大写等价物和特定于地区的顺序之前进行排序,可以适用于具有对话式的字符。在某些地区,一组字符比较起来是单个的。校对单位例如,"ch"捷克文如下"h"先于"i",和"dzs"匈牙利文如下"dz"先于"g"...

另见

collatedefines lexicographical comparison and hashing of strings (class template)
strcollcompares two strings in accordance to the current locale (function)
wcscollcompares two wide strings in accordance to the current locale (function)
operator()lexicographically compares two strings using this locale's collate facet (public member function of std::locale)

© cppreference.com

在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。

http://en.cppreference.com/w/cpp/locale/COLATE[医]名名