std::locale::combine
Defined in header <locale> | | |
|---|---|---|
template< class Facet > locale combine( const locale& other ) const; | | |
构造一个区域设置对象,该对象是*this除了类型的面Facet,它是从other...
返回值
新的无名的地方。
例外
std::runtime_error如果other不实现Facet...
例
二次
#include <iostream>
#include <locale>
int main()
{
const double number = 1000.25;
std::cout << "\"C\" locale: " << number << '\n';
std::locale loc = std::locale().combine<std::numpunct<char>>(std::locale("en_US.UTF8"));
std::cout.imbue(loc);
std::cout << "\"C\" locale with en_US numpunct: " << number << '\n';
}二次
产出:
二次
"C" locale: 1000.25
"C" locale with en_US numpunct: 1,000.25二次
另见
(constructor) | constructs a new locale (public member function) |
|---|
© cppreference.com在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。
本文档系腾讯云开发者社区成员共同维护,如有问题请联系 cloudcommunity@tencent.com

