c语言combine函数,combine

combine

描述 (Description)

它构造修改一个facet的locale副本,并返回一个由* this副本构造的locale对象,但模板参数Facet指定的facet除外,它取自x。

声明 (Declaration)

以下是std :: locale :: combine的声明。

C++98template locale combine (const locale& x) const;

C++11template locale combine (const locale& x) const;

参数 (Parameters)

x - 这是一个区域设置对象,其facet Facet由新的区域设置使用。

返回值 (Return Value)

它返回生成的区域设置对象,该对象没有名称。

异常 (Exceptions)

Basic guarantee - 如果抛出异常,则对象处于有效状态。

数据竞争 (Data races)

区域设置对象已修改。

例子 (Example)

在下面的例子中解释了std :: locale :: combine。#include

#include

int main () {

std::locale loc("");

loc = loc.combine< std::num_put > (std::locale::classic());

std::cout.imbue(loc);

std::cout << 3.1 << '\n';

return 0;

}

让我们编译并运行上面的程序,这将产生以下结果 -3.1

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值