#include #include #include #include "phone.h" #include "us_phone_put.h" using namespace std; int main() { if (!has_facet >(cout.getloc())) { cout << "The locale \"" << cout.getloc().name() << "\" has no phone_facet.\n"; } const phone p = 2345678; cout << p << "\n\n"; const locale loc(cout.getloc(), new us_phone_put); if (has_facet >(loc) && has_facet >(loc)) { cout << "The locale \"" << loc.name() << "\" has phone_put and us_phone_put.\n"; } cout.imbue(loc); cout << p << "\n"; wcout.imbue(locale(wcout.getloc(), new us_phone_put)); wcout << p << "\n"; return EXIT_SUCCESS; }