首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

std::locale::combine

Defined in header <locale>

?

?

template< class Facet > locale combine( const locale& other ) const;

?

?

构造一个区域设置对象,该对象是*this除了类型的面Facet,它是从other...

返回值

新的无名的地方。

例外

std::runtime_error如果other不实现Facet...

二次

代码语言:javascript
复制
#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';
}

二次

产出:

二次

代码语言:javascript
复制
"C" locale: 1000.25
"C" locale with en_US numpunct: 1,000.25

二次

另见

(constructor)

constructs a new locale (public member function)

代码语言:txt
复制
 ? cppreference.com

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

扫码关注腾讯云开发者

领取腾讯云代金券

http://www.vxiaotou.com