diff --git a/include/chaiscript/dispatchkit/boxed_value.hpp b/include/chaiscript/dispatchkit/boxed_value.hpp index 06941b2f..930f8766 100644 --- a/include/chaiscript/dispatchkit/boxed_value.hpp +++ b/include/chaiscript/dispatchkit/boxed_value.hpp @@ -31,7 +31,7 @@ namespace chaiscript { /// structure which holds the internal state of a Boxed_Value /// \todo Get rid of Any and merge it with this, reducing an allocation in the process struct Data { - Data(const Type_Info &ti, chaiscript::detail::Any to, bool is_ref, const void *t_void_ptr, bool t_return_value) + Data(const Type_Info &ti, chaiscript::detail::Any to, bool is_ref, const void *t_void_ptr, bool t_return_value) noexcept : m_type_info(ti) , m_obj(std::move(to)) , m_data_ptr(ti.is_const() ? nullptr : const_cast(t_void_ptr)) diff --git a/include/chaiscript/language/chaiscript_eval.hpp b/include/chaiscript/language/chaiscript_eval.hpp index 4997d667..cd171b36 100644 --- a/include/chaiscript/language/chaiscript_eval.hpp +++ b/include/chaiscript/language/chaiscript_eval.hpp @@ -501,13 +501,7 @@ namespace chaiscript { } Boxed_Value eval_internal(const chaiscript::detail::Dispatch_State &t_ss) const override { - const std::string &idname = [&]() -> const std::string & { - if (this->children[0]->identifier == AST_Node_Type::Reference) { - return this->children[0]->children[0]->text; - } else { - return this->children[0]->text; - } - }(); + const std::string &idname = (this->children[0]->identifier == AST_Node_Type::Reference) ? this->children[0]->children[0]->text : this->children[0]->text; return t_ss->add_global_no_throw(Boxed_Value(), idname); } diff --git a/src/test_module.cpp b/src/test_module.cpp index 6568b9b2..5da2d389 100644 --- a/src/test_module.cpp +++ b/src/test_module.cpp @@ -5,30 +5,30 @@ class TestBaseType { public: - TestBaseType() + TestBaseType() noexcept : val(10) , const_val(15) , mdarray{} { } - TestBaseType(int) + TestBaseType(int) noexcept : val(10) , const_val(15) , mdarray{} { } - TestBaseType(int *) + TestBaseType(int *) noexcept : val(10) , const_val(15) , mdarray{} { } - TestBaseType(const TestBaseType &other) + TestBaseType(const TestBaseType &other) noexcept : val(other.val) , const_val(other.const_val) , const_val_ptr(&const_val) , func_member(other.func_member) { } - TestBaseType(TestBaseType &&other) + TestBaseType(TestBaseType &&other) noexcept : val(other.val) , const_val(other.const_val) , const_val_ptr(&const_val) @@ -59,7 +59,7 @@ public: class Type2 { public: - Type2(TestBaseType t_bt) + Type2(TestBaseType t_bt) noexcept : m_bt(std::move(t_bt)) , m_str("Hello World") { }