From 2aebad5dac3a8290f389b9821b1241a7275c2dda Mon Sep 17 00:00:00 2001 From: gfgtdf Date: Sun, 18 May 2014 22:51:06 +0200 Subject: [PATCH] derive bad_lexical_cast from std::exception --- src/util.hpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/util.hpp b/src/util.hpp index 31f11c2d1bab..398c2945e3b0 100644 --- a/src/util.hpp +++ b/src/util.hpp @@ -73,7 +73,14 @@ inline double round_portable(double d) { return (d >= 0.0) ? std::floor(d + 0.5) : std::ceil(d - 0.5); } -struct bad_lexical_cast {}; +struct bad_lexical_cast : std::exception +{ +public: + const char *what() const throw() + { + return "bad_lexical_cast"; + } +}; template To lexical_cast(From a)