diff --git a/include/chaiscript/dispatchkit/any.hpp b/include/chaiscript/dispatchkit/any.hpp index a6cce3d..90b6336 100644 --- a/include/chaiscript/dispatchkit/any.hpp +++ b/include/chaiscript/dispatchkit/any.hpp @@ -19,15 +19,15 @@ namespace chaiscript { class bad_any_cast : public std::bad_cast { public: - bad_any_cast() throw() + bad_any_cast() noexcept : m_what("bad any cast") { } - virtual ~bad_any_cast() throw() {} + virtual ~bad_any_cast() noexcept {} /// \brief Description of what error occured - virtual const char * what() const throw() + virtual const char * what() const noexcept { return m_what.c_str(); } @@ -79,7 +79,7 @@ namespace chaiscript { public: // construct/copy/destruct - Any() {} + Any() = default; Any(const Any &t_any) { diff --git a/include/chaiscript/dispatchkit/bad_boxed_cast.hpp b/include/chaiscript/dispatchkit/bad_boxed_cast.hpp index ef26d0b..53200c0 100644 --- a/include/chaiscript/dispatchkit/bad_boxed_cast.hpp +++ b/include/chaiscript/dispatchkit/bad_boxed_cast.hpp @@ -22,25 +22,25 @@ namespace chaiscript { public: bad_boxed_cast(const Type_Info &t_from, const std::type_info &t_to, - const std::string &t_what) throw() + const std::string &t_what) noexcept : from(t_from), to(&t_to), m_what(t_what) { } - bad_boxed_cast(const Type_Info &t_from, const std::type_info &t_to) throw() + bad_boxed_cast(const Type_Info &t_from, const std::type_info &t_to) noexcept : from(t_from), to(&t_to), m_what("Cannot perform boxed_cast") { } - bad_boxed_cast(const std::string &t_what) throw() + bad_boxed_cast(const std::string &t_what) noexcept : m_what(t_what) { } - virtual ~bad_boxed_cast() throw() {} + virtual ~bad_boxed_cast() noexcept {} /// \brief Description of what error occured - virtual const char * what() const throw() + virtual const char * what() const noexcept { return m_what.c_str(); } diff --git a/include/chaiscript/dispatchkit/dispatchkit.hpp b/include/chaiscript/dispatchkit/dispatchkit.hpp index 1d51639..257379e 100644 --- a/include/chaiscript/dispatchkit/dispatchkit.hpp +++ b/include/chaiscript/dispatchkit/dispatchkit.hpp @@ -41,12 +41,12 @@ namespace chaiscript class reserved_word_error : public std::runtime_error { public: - reserved_word_error(const std::string &t_word) throw() + reserved_word_error(const std::string &t_word) noexcept : std::runtime_error("Reserved word not allowed in object name: " + t_word), m_word(t_word) { } - virtual ~reserved_word_error() throw() {} + virtual ~reserved_word_error() noexcept {} std::string word() const { @@ -64,12 +64,12 @@ namespace chaiscript class global_non_const : public std::runtime_error { public: - global_non_const() throw() + global_non_const() noexcept : std::runtime_error("a global object must be const") { } - virtual ~global_non_const() throw() {} + virtual ~global_non_const() noexcept {} }; } diff --git a/include/chaiscript/dispatchkit/dynamic_cast_conversion.hpp b/include/chaiscript/dispatchkit/dynamic_cast_conversion.hpp index f6fb7bf..9fce9cf 100644 --- a/include/chaiscript/dispatchkit/dynamic_cast_conversion.hpp +++ b/include/chaiscript/dispatchkit/dynamic_cast_conversion.hpp @@ -20,22 +20,22 @@ namespace chaiscript { public: bad_boxed_dynamic_cast(const Type_Info &t_from, const std::type_info &t_to, - const std::string &t_what) throw() + const std::string &t_what) noexcept : bad_boxed_cast(t_from, t_to, t_what) { } - bad_boxed_dynamic_cast(const Type_Info &t_from, const std::type_info &t_to) throw() + bad_boxed_dynamic_cast(const Type_Info &t_from, const std::type_info &t_to) noexcept : bad_boxed_cast(t_from, t_to) { } - bad_boxed_dynamic_cast(const std::string &w) throw() + bad_boxed_dynamic_cast(const std::string &w) noexcept : bad_boxed_cast(w) { } - virtual ~bad_boxed_dynamic_cast() throw() {} + virtual ~bad_boxed_dynamic_cast() noexcept {} }; } diff --git a/include/chaiscript/dispatchkit/proxy_functions.hpp b/include/chaiscript/dispatchkit/proxy_functions.hpp index 5225121..aa5ba0e 100644 --- a/include/chaiscript/dispatchkit/proxy_functions.hpp +++ b/include/chaiscript/dispatchkit/proxy_functions.hpp @@ -188,11 +188,11 @@ namespace chaiscript class guard_error : public std::runtime_error { public: - guard_error() throw() + guard_error() noexcept : std::runtime_error("Guard evaluation failed") { } - virtual ~guard_error() throw() + virtual ~guard_error() noexcept { } }; } @@ -587,17 +587,17 @@ namespace chaiscript class dispatch_error : public std::runtime_error { public: - dispatch_error() throw() + dispatch_error() noexcept : std::runtime_error("No matching function to dispatch to") { } - dispatch_error(bool is_const) throw() + dispatch_error(bool is_const) noexcept : std::runtime_error(std::string("No matching function to dispatch to") + (is_const?", parameter is const":"")) { } - virtual ~dispatch_error() throw() {} + virtual ~dispatch_error() noexcept {} }; } diff --git a/include/chaiscript/dispatchkit/proxy_functions_detail.hpp b/include/chaiscript/dispatchkit/proxy_functions_detail.hpp index 6900f14..f8901e3 100644 --- a/include/chaiscript/dispatchkit/proxy_functions_detail.hpp +++ b/include/chaiscript/dispatchkit/proxy_functions_detail.hpp @@ -32,7 +32,7 @@ namespace chaiscript { } - virtual ~arity_error() throw() {} + virtual ~arity_error() noexcept {} int got; int expected; diff --git a/include/chaiscript/language/chaiscript_common.hpp b/include/chaiscript/language/chaiscript_common.hpp index 5fbb209..84b1f80 100644 --- a/include/chaiscript/language/chaiscript_common.hpp +++ b/include/chaiscript/language/chaiscript_common.hpp @@ -70,17 +70,17 @@ namespace chaiscript std::string filename; std::vector call_stack; - eval_error(const std::string &t_why, const File_Position &t_where, const std::string &t_fname) throw() : + eval_error(const std::string &t_why, const File_Position &t_where, const std::string &t_fname) noexcept : std::runtime_error(format(t_why, t_where, t_fname)), reason(t_why), start_position(t_where), end_position(t_where), filename(t_fname) { } - eval_error(const std::string &t_why) throw() + eval_error(const std::string &t_why) noexcept : std::runtime_error("Error: \"" + t_why + "\" "), reason(t_why) {} - virtual ~eval_error() throw() {} + virtual ~eval_error() noexcept {} private: static std::string format(const std::string &t_why, const File_Position &t_where, const std::string &t_fname) @@ -98,11 +98,11 @@ namespace chaiscript * Errors generated when loading a file */ struct file_not_found_error : public std::runtime_error { - file_not_found_error(const std::string &t_filename) throw() + file_not_found_error(const std::string &t_filename) noexcept : std::runtime_error("File Not Found: " + t_filename) { } - virtual ~file_not_found_error() throw() {} + virtual ~file_not_found_error() noexcept {} }; } diff --git a/include/chaiscript/language/chaiscript_engine.hpp b/include/chaiscript/language/chaiscript_engine.hpp index c7ec0bf..ecc82b6 100644 --- a/include/chaiscript/language/chaiscript_engine.hpp +++ b/include/chaiscript/language/chaiscript_engine.hpp @@ -35,12 +35,12 @@ namespace chaiscript /// \brief Thrown if an error occurs while attempting to load a binary module struct load_module_error : std::runtime_error { - load_module_error(const std::string &t_reason) throw() + load_module_error(const std::string &t_reason) noexcept : std::runtime_error(t_reason) { } - virtual ~load_module_error() throw() + virtual ~load_module_error() noexcept { } };