diff --git a/include/chaiscript/dispatchkit/boxed_cast_helper.hpp b/include/chaiscript/dispatchkit/boxed_cast_helper.hpp index 8f478bf..0e8870d 100644 --- a/include/chaiscript/dispatchkit/boxed_cast_helper.hpp +++ b/include/chaiscript/dispatchkit/boxed_cast_helper.hpp @@ -166,11 +166,11 @@ namespace chaiscript template<> struct Cast_Helper_Inner { - typedef const Boxed_Value & Result_Type; + typedef std::reference_wrapper Result_Type; static Result_Type cast(const Boxed_Value &ob, const Type_Conversions *) { - return ob; + return std::cref(ob); } }; @@ -178,11 +178,11 @@ namespace chaiscript template<> struct Cast_Helper_Inner { - typedef Boxed_Value& Result_Type; + typedef std::reference_wrapper Result_Type; static Result_Type cast(const Boxed_Value &ob, const Type_Conversions *) { - return const_cast(ob); + return std::ref(const_cast(ob)); } }; diff --git a/samples/test_num_exceptions.cpp b/samples/test_num_exceptions.cpp index 371d7f1..ba97f7a 100644 --- a/samples/test_num_exceptions.cpp +++ b/samples/test_num_exceptions.cpp @@ -3,7 +3,7 @@ #include #include -int main( int argc , char * argv[] ) +int main( int /*argc*/ , char * /*argv*/[] ) { chaiscript::ChaiScript ch( chaiscript::Std_Lib::library( ) );