//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // class moneypunct // string_type negative_sign() const; // The C++ and C standards are silent. // On this one, commen sense is the guideline. // If customers complain, I'll endeavor to minimize customer complaints #include #include #include typedef std::moneypunct F; class Fnf : public std::moneypunct { public: explicit Fnf(std::size_t refs = 0) : std::moneypunct(refs) {} }; class Fnt : public std::moneypunct { public: explicit Fnt(std::size_t refs = 0) : std::moneypunct(refs) {} }; class Fwf : public std::moneypunct { public: explicit Fwf(std::size_t refs = 0) : std::moneypunct(refs) {} }; class Fwt : public std::moneypunct { public: explicit Fwt(std::size_t refs = 0) : std::moneypunct(refs) {} }; int main() { { Fnf f(1); assert(f.negative_sign() == "-"); } { Fnt f(1); assert(f.negative_sign() == "-"); } { Fwf f(1); assert(f.negative_sign() == L"-"); } { Fwt f(1); assert(f.negative_sign() == L"-"); } }