#include #include #include #include //for locale, has_facet #include "roman.h" //for roman_put using namespace std; int main() { const locale& save = cout.getloc(); if (has_facet(cout.getloc())) { cout << "cout's locale has roman_put.\n"; } const locale loc(save, new roman_put); cout << "Name of new locale is \"" << loc.name() << "\".\n"; cout.imbue(loc); if (has_facet(cout.getloc())) { cout << "cout's locale has roman_put.\n"; } cout << setfill('*') << setw(5) << 3 << "\n" << left << uppercase << setw(5) << 4 << "\n" << 3.14159 << "\n"; cout.imbue(save); cout << 3 << "\n"; return EXIT_SUCCESS; }