mirror of
https://github.com/ChaiScript/ChaiScript.git
synced 2026-02-07 10:19:57 +08:00
Switch to using make_sharec
This commit is contained in:
parent
179a674b00
commit
927619bf47
@ -71,12 +71,12 @@ namespace chaiscript
|
|||||||
{
|
{
|
||||||
static std::shared_ptr<Data> get(Boxed_Value::Void_Type)
|
static std::shared_ptr<Data> get(Boxed_Value::Void_Type)
|
||||||
{
|
{
|
||||||
return std::shared_ptr<Data> (new Data(
|
return std::make_shared<Data>(
|
||||||
detail::Get_Type_Info<void>::get(),
|
detail::Get_Type_Info<void>::get(),
|
||||||
chaiscript::detail::Any(),
|
chaiscript::detail::Any(),
|
||||||
false,
|
false,
|
||||||
0)
|
nullptr)
|
||||||
);
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
@ -88,11 +88,11 @@ namespace chaiscript
|
|||||||
template<typename T>
|
template<typename T>
|
||||||
static std::shared_ptr<Data> get(const std::shared_ptr<T> &obj)
|
static std::shared_ptr<Data> get(const std::shared_ptr<T> &obj)
|
||||||
{
|
{
|
||||||
return std::shared_ptr<Data>(new Data(
|
return std::make_shared<Data>(
|
||||||
detail::Get_Type_Info<T>::get(),
|
detail::Get_Type_Info<T>::get(),
|
||||||
chaiscript::detail::Any(obj),
|
chaiscript::detail::Any(obj),
|
||||||
false,
|
false,
|
||||||
obj.get())
|
obj.get()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -105,33 +105,33 @@ namespace chaiscript
|
|||||||
template<typename T>
|
template<typename T>
|
||||||
static std::shared_ptr<Data> get(std::reference_wrapper<T> obj)
|
static std::shared_ptr<Data> get(std::reference_wrapper<T> obj)
|
||||||
{
|
{
|
||||||
return std::shared_ptr<Data>(new Data(
|
return std::make_shared<Data>(
|
||||||
detail::Get_Type_Info<T>::get(),
|
detail::Get_Type_Info<T>::get(),
|
||||||
chaiscript::detail::Any(obj),
|
chaiscript::detail::Any(obj),
|
||||||
true,
|
true,
|
||||||
&obj.get())
|
&obj.get()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
static std::shared_ptr<Data> get(const T& t)
|
static std::shared_ptr<Data> get(const T& t)
|
||||||
{
|
{
|
||||||
std::shared_ptr<T> p(new T(t));
|
auto p = std::make_shared<T>(t);
|
||||||
return std::shared_ptr<Data>(new Data(
|
return std::make_shared<Data>(
|
||||||
detail::Get_Type_Info<T>::get(),
|
detail::Get_Type_Info<T>::get(),
|
||||||
chaiscript::detail::Any(p),
|
chaiscript::detail::Any(p),
|
||||||
false,
|
false,
|
||||||
p.get())
|
p.get()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
static std::shared_ptr<Data> get()
|
static std::shared_ptr<Data> get()
|
||||||
{
|
{
|
||||||
return std::shared_ptr<Data> (new Data(
|
return std::make_shared<Data>(
|
||||||
Type_Info(),
|
Type_Info(),
|
||||||
chaiscript::detail::Any(),
|
chaiscript::detail::Any(),
|
||||||
false,
|
false,
|
||||||
0)
|
nullptr
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user