X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Fstrings%2Flexicalcast.h;h=393622d54771bb5197886a7423627fce6066b519;hp=22b45e88c55eef60e433b6253d0070b77c9242a5;hb=991fabc1956b73a4007859058fb44171000b452e;hpb=4f04dc8e2dcb48d524c141cb14ce05b655608454 diff --git a/source/strings/lexicalcast.h b/source/strings/lexicalcast.h index 22b45e8..393622d 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() { } + ~lexical_error() throw() override = 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() { } + ~format_mismatch() throw() override = 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; } @@ -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());