How to get facet from std :: locale object?

I want to get the numpunct <char> face for the native locale. I can create my own local object by building an object with an empty string std::locale native_loc(""), but as soon as I get it, how do I get it numpunct? The documentation I found does not really show the relationship between the two.

+5
source share
1 answer

Use use_facet<facet_type>(locale):

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

All Articles