I want to get the numpunct<char> facet for the native locale. I can generate a native locale 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.
views:
37answers:
1
+2
A:
Use use_facet<facet_type>(locale)
:
std::numpunct<char> const&n = std::use_facet< std::numpunct<char> >(std::locale(""));
Johannes Schaub - litb
2010-03-04 19:03:03
Worked perfectly, thanks. I missed that when I was looking at the documentation for `<locale>`.
Mark Ransom
2010-03-04 19:10:55