Remove redundant/unnecessary constructors and object copies.

This commit is contained in:
Jason Turner 2015-01-09 19:06:08 -07:00
parent de09489355
commit 1a4dec0df0

View File

@ -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<T>::value) if(n==0) throw chaiscript::exception::arithmetic_error("divide by zero");