diff --git a/include/chaiscript/dispatchkit/boxed_value.hpp b/include/chaiscript/dispatchkit/boxed_value.hpp index 5b88f9d..538391f 100644 --- a/include/chaiscript/dispatchkit/boxed_value.hpp +++ b/include/chaiscript/dispatchkit/boxed_value.hpp @@ -77,9 +77,9 @@ namespace chaiscript struct Object_Data { - static std::shared_ptr get(Boxed_Value::Void_Type, bool t_return_value) + static std::unique_ptr get(Boxed_Value::Void_Type, bool t_return_value) { - return std::make_shared( + return std::make_unique( detail::Get_Type_Info::get(), chaiscript::detail::Any(), false, @@ -89,15 +89,15 @@ namespace chaiscript } template - static std::shared_ptr get(const std::shared_ptr *obj, bool t_return_value) + static std::unique_ptr get(const std::shared_ptr *obj, bool t_return_value) { return get(*obj, t_return_value); } template - static std::shared_ptr get(const std::shared_ptr &obj, bool t_return_value) + static std::unique_ptr get(const std::shared_ptr &obj, bool t_return_value) { - return std::make_shared( + return std::make_unique( detail::Get_Type_Info::get(), chaiscript::detail::Any(obj), false, @@ -107,10 +107,10 @@ namespace chaiscript } template - static std::shared_ptr get(std::shared_ptr &&obj, bool t_return_value) + static std::unique_ptr get(std::shared_ptr &&obj, bool t_return_value) { auto ptr = obj.get(); - return std::make_shared( + return std::make_unique( detail::Get_Type_Info::get(), chaiscript::detail::Any(std::move(obj)), false, @@ -120,23 +120,23 @@ namespace chaiscript } template - static std::shared_ptr get(T *t, bool t_return_value) + static std::unique_ptr get(T *t, bool t_return_value) { return get(std::ref(*t), t_return_value); } template - static std::shared_ptr get(const T *t, bool t_return_value) + static std::unique_ptr get(const T *t, bool t_return_value) { return get(std::cref(*t), t_return_value); } template - static std::shared_ptr get(std::reference_wrapper obj, bool t_return_value) + static std::unique_ptr get(std::reference_wrapper obj, bool t_return_value) { auto p = &obj.get(); - return std::make_shared( + return std::make_unique( detail::Get_Type_Info::get(), chaiscript::detail::Any(std::move(obj)), true, @@ -146,11 +146,11 @@ namespace chaiscript } template - static std::shared_ptr get(T t, bool t_return_value) + static std::unique_ptr get(T t, bool t_return_value) { auto p = std::make_shared(std::move(t)); auto ptr = p.get(); - return std::make_shared( + return std::make_unique( detail::Get_Type_Info::get(), chaiscript::detail::Any(std::move(p)), false, @@ -159,9 +159,9 @@ namespace chaiscript ); } - static std::shared_ptr get() + static std::unique_ptr get() { - return std::make_shared( + return std::make_unique( Type_Info(), chaiscript::detail::Any(), false,