From 1a4dec0df070de2ce9e6297a9f859da64fc5ba3d Mon Sep 17 00:00:00 2001 From: Jason Turner Date: Fri, 9 Jan 2015 19:06:08 -0700 Subject: [PATCH] Remove redundant/unnecessary constructors and object copies. --- include/chaiscript/dispatchkit/boxed_number.hpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/include/chaiscript/dispatchkit/boxed_number.hpp b/include/chaiscript/dispatchkit/boxed_number.hpp index 1eefcc9..16022ca 100644 --- a/include/chaiscript/dispatchkit/boxed_number.hpp +++ b/include/chaiscript/dispatchkit/boxed_number.hpp @@ -28,10 +28,7 @@ namespace chaiscript { struct arithmetic_error : public std::runtime_error { - std::string reason; - - arithmetic_error(const std::string& reason) : std::runtime_error(std::string("Arithmetic error: ").append(reason)), reason(reason) {} - arithmetic_error(const char* reason) : std::runtime_error(std::string("Arithmetic error: ").append(reason)), reason(reason) {} + arithmetic_error(const std::string& reason) : std::runtime_error("Arithmetic error: " + reason) {} virtual ~arithmetic_error() {} }; #define CHAISCRIPT_ARITHMETIC_CHECKDIVIDEBYZERO(T, n) if(std::is_arithmetic::value) if(n==0) throw chaiscript::exception::arithmetic_error("divide by zero");