开发者

How to get a facet from a std::locale object?

开发者 https://www.devze.com 2022-12-22 10:13 出处:网络
I want to get the numpunct<char> facet for the native locale.I can generate a native lo开发者_JS百科cale object by constructing an object with an empty string std::locale native_loc(\"\"), but once

I want to get the numpunct<char> facet for the native locale. I can generate a native lo开发者_JS百科cale object by constructing an object with an empty string std::locale native_loc(""), but once I have it how do I get a numpunct from it? The documentation I've found doesn't really show the connection between the two.


Use use_facet<facet_type>(locale):

std::numpunct<char> const&n = std::use_facet< std::numpunct<char> >(std::locale(""));
0

精彩评论

暂无评论...
验证码 换一张
取 消