X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fstrings%2Flexicalcast.h;h=0c5f0a34caa38844be7265c8366e9be34ea1ea47;hb=26a5878092f6547e701fd1a33abbf1878d26ab70;hp=6fe3cb366b24015ea215c127913db9f43ac42276;hpb=b65e1d0856c1fb677558a941f3cd858849ee3b28;p=libs%2Fcore.git diff --git a/source/strings/lexicalcast.h b/source/strings/lexicalcast.h index 6fe3cb3..0c5f0a3 100644 --- a/source/strings/lexicalcast.h +++ b/source/strings/lexicalcast.h @@ -16,7 +16,7 @@ class lexical_error: public std::runtime_error { public: lexical_error(const std::string &w): runtime_error(w) { } - virtual ~lexical_error() throw() { } + virtual ~lexical_error() throw() = default; }; @@ -27,7 +27,7 @@ class format_mismatch: public lexical_error { public: format_mismatch(const std::string &w): lexical_error(w) { } - virtual ~format_mismatch() throw() { } + virtual ~format_mismatch() throw() = default; }; @@ -38,11 +38,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; } @@ -97,7 +97,7 @@ struct CheckFormattedOutput: Sfinae { static std::ostream &s; template - static Yes f(int (*)[sizeof(s<(s))]); using Sfinae::f; }; @@ -114,7 +114,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 +123,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());