From bdd3806aa4f7d46c78375a342e0821866dc6dcf7 Mon Sep 17 00:00:00 2001 From: Jinhao Date: Tue, 12 Apr 2016 23:09:39 +0800 Subject: [PATCH] add workaround for lack support of C++11 feature --- include/nana/deploy.hpp | 7 +++++++ source/deploy.cpp | 12 ++++++++++++ 2 files changed, 19 insertions(+) diff --git a/include/nana/deploy.hpp b/include/nana/deploy.hpp index f031c66d..342adfe7 100644 --- a/include/nana/deploy.hpp +++ b/include/nana/deploy.hpp @@ -121,6 +121,13 @@ namespace nana using std::runtime_error::runtime_error; +#if defined(_MSC_VER) +# if (_MSC_VER < 1900) + //A workaround for lack support of C++11 inheriting constructors for VC2013 + explicit utf8_Error(const std::string& msg); +# endif +#endif + void emit(); }; diff --git a/source/deploy.cpp b/source/deploy.cpp index eb79b86a..3e6dfcf7 100644 --- a/source/deploy.cpp +++ b/source/deploy.cpp @@ -513,6 +513,17 @@ namespace nana return true; } + //class utf8_Error + +#if defined(_MSC_VER) +# if (_MSC_VER < 1900) + //A workaround for lack support of C++11 inheriting constructors for VC2013 + utf8_Error::utf8_Error(const std::string& msg) + : std::runtime_error(msg) + {} +# endif +#endif + void utf8_Error::emit() { if (use_throw) @@ -522,6 +533,7 @@ namespace nana //bool utf8_Error::use_throw{true}; bool utf8_Error::use_throw{ false }; + //end class utf8_Error void throw_not_utf8(const std::string& text) {