diff --git a/include/chaiscript/dispatchkit/boxed_value.hpp b/include/chaiscript/dispatchkit/boxed_value.hpp index a987e2c..660db0c 100644 --- a/include/chaiscript/dispatchkit/boxed_value.hpp +++ b/include/chaiscript/dispatchkit/boxed_value.hpp @@ -71,12 +71,12 @@ namespace chaiscript { static std::shared_ptr get(Boxed_Value::Void_Type) { - return std::shared_ptr (new Data( + return std::make_shared( detail::Get_Type_Info::get(), chaiscript::detail::Any(), false, - 0) - ); + nullptr) + ; } template @@ -88,11 +88,11 @@ namespace chaiscript template static std::shared_ptr get(const std::shared_ptr &obj) { - return std::shared_ptr(new Data( + return std::make_shared( detail::Get_Type_Info::get(), chaiscript::detail::Any(obj), false, - obj.get()) + obj.get() ); } @@ -105,33 +105,33 @@ namespace chaiscript template static std::shared_ptr get(std::reference_wrapper obj) { - return std::shared_ptr(new Data( + return std::make_shared( detail::Get_Type_Info::get(), chaiscript::detail::Any(obj), true, - &obj.get()) + &obj.get() ); } template static std::shared_ptr get(const T& t) { - std::shared_ptr p(new T(t)); - return std::shared_ptr(new Data( + auto p = std::make_shared(t); + return std::make_shared( detail::Get_Type_Info::get(), chaiscript::detail::Any(p), false, - p.get()) + p.get() ); } static std::shared_ptr get() { - return std::shared_ptr (new Data( + return std::make_shared( Type_Info(), chaiscript::detail::Any(), false, - 0) + nullptr ); }