#include #include #include #include //for ostream_iterator #include //for transform #include "convert.h" //for convert using namespace std; int main(int argc, char **argv) { const locale loc = cout.getloc(); if (has_facet >(loc)) { const numpunct& f = use_facet >(loc); cout << "truename: \"" << f.truename() << "\"\n" << "falsename: \"" << f.falsename() << "\"\n" << "decimal point: '" << f.decimal_point() << "'\n" << "thousands sep: '" << f.thousands_sep() << "'\n"; cout << "grouping: "; const string s = f.grouping(); transform(s.begin(), s.end(), ostream_iterator(cout, " "), convert() ); cout << "\n"; } if (has_facet >(loc)) { const num_put& f = use_facet >(loc); const num_put::iter_type it = f.put(cout, cout, cout.fill(), 1234.56); if (it.failed()) { cerr << "put failed\n"; return EXIT_FAILURE; } cout << "\n"; } return EXIT_SUCCESS; }