X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fstrings%2Flexicalcast.h;h=12b5d08a1c9e3689f8ada501bc63a33931c9052d;hb=672dd8d4178716824bf21a76685d91fc82a0a4af;hp=6fe3cb366b24015ea215c127913db9f43ac42276;hpb=b65e1d0856c1fb677558a941f3cd858849ee3b28;p=libs%2Fcore.git diff --git a/source/strings/lexicalcast.h b/source/strings/lexicalcast.h index 6fe3cb3..12b5d08 100644 --- a/source/strings/lexicalcast.h +++ b/source/strings/lexicalcast.h @@ -16,7 +16,6 @@ class lexical_error: public std::runtime_error { public: lexical_error(const std::string &w): runtime_error(w) { } - virtual ~lexical_error() throw() { } }; @@ -27,7 +26,6 @@ class format_mismatch: public lexical_error { public: format_mismatch(const std::string &w): lexical_error(w) { } - virtual ~format_mismatch() throw() { } }; @@ -38,11 +36,11 @@ class LexicalConverter { private: Fmt fmt; - bool filled; + bool filled = false; std::string buf; public: - LexicalConverter(const Fmt &f): fmt(f), filled(false) { } + LexicalConverter(const Fmt &f): fmt(f) { } LexicalConverter(const std::string &s, const Fmt &f): fmt(f), filled(true), buf(s) { } const Fmt &get_fmt() const { return fmt; } @@ -60,10 +58,8 @@ void operator<<(LexicalConverter &, unsigned char); void operator<<(LexicalConverter &, unsigned short); void operator<<(LexicalConverter &, unsigned); void operator<<(LexicalConverter &, unsigned long); -#ifdef __GNUC__ void operator<<(LexicalConverter &, long long); void operator<<(LexicalConverter &, unsigned long long); -#endif void operator<<(LexicalConverter &, bool); void operator<<(LexicalConverter &, float); void operator<<(LexicalConverter &, double); @@ -81,10 +77,8 @@ void operator>>(const LexicalConverter &, unsigned char &); void operator>>(const LexicalConverter &, unsigned short &); void operator>>(const LexicalConverter &, unsigned int &); void operator>>(const LexicalConverter &, unsigned long &); -#ifdef __GNUC__ void operator>>(const LexicalConverter &, long long &); void operator>>(const LexicalConverter &, unsigned long long &); -#endif void operator>>(const LexicalConverter &, bool &); void operator>>(const LexicalConverter &, float &); void operator>>(const LexicalConverter &, double &); @@ -97,7 +91,7 @@ struct CheckFormattedOutput: Sfinae { static std::ostream &s; template - static Yes f(int (*)[sizeof(s<(s))]); using Sfinae::f; }; @@ -114,7 +108,7 @@ template struct HasFormattedInput: Sfinae::Evaluate -typename EnableIf::value, void>::Yes +typename std::enable_if::value>::type operator<<(LexicalConverter &c, const T &v) { std::ostringstream ss; @@ -123,7 +117,7 @@ operator<<(LexicalConverter &c, const T &v) } template -typename EnableIf::value, void>::Yes +typename std::enable_if::value>::type operator>>(const LexicalConverter &c, T &v) { std::istringstream ss(c.get());