Remove more usage of new

This commit is contained in:
Jason Turner 2015-05-19 14:15:21 -06:00
parent 5fa44d5eef
commit da39b8403b

View File

@ -54,9 +54,7 @@ namespace chaiscript
{ {
static Boxed_Value handle(const std::function<Ret> &f) { static Boxed_Value handle(const std::function<Ret> &f) {
return Boxed_Value( return Boxed_Value(
std::shared_ptr<dispatch::Proxy_Function_Base>( chaiscript::make_shared<dispatch::Proxy_Function_Base, dispatch::Proxy_Function_Impl<Ret>>(f)
new dispatch::Proxy_Function_Impl<Ret>(f)
)
); );
} }
}; };
@ -66,9 +64,7 @@ namespace chaiscript
{ {
static Boxed_Value handle(const std::function<Ret> &f) { static Boxed_Value handle(const std::function<Ret> &f) {
return Boxed_Value( return Boxed_Value(
std::shared_ptr<dispatch::Proxy_Function_Base>( chaiscript::make_shared<dispatch::Proxy_Function_Base, dispatch::Proxy_Function_Impl<Ret>>(f)
new Proxy_Function_Impl<Ret>(f)
)
); );
} }
}; };
@ -78,12 +74,7 @@ namespace chaiscript
{ {
static Boxed_Value handle(const std::shared_ptr<std::function<Ret>> &f) { static Boxed_Value handle(const std::shared_ptr<std::function<Ret>> &f) {
return Boxed_Value( return Boxed_Value(
std::shared_ptr<Proxy_Function_Base>( chaiscript::make_shared<dispatch::Proxy_Function_Base, dispatch::Assignable_Proxy_Function_Impl<Ret>>(std::ref(*f),f)
new Assignable_Proxy_Function_Impl<Ret>(
std::ref(*f),
f
)
)
); );
} }
}; };
@ -93,12 +84,7 @@ namespace chaiscript
{ {
static Boxed_Value handle(const std::shared_ptr<std::function<Ret>> &f) { static Boxed_Value handle(const std::shared_ptr<std::function<Ret>> &f) {
return Boxed_Value( return Boxed_Value(
std::shared_ptr<Proxy_Function_Base>( chaiscript::make_shared<dispatch::Proxy_Function_Base, dispatch::Assignable_Proxy_Function_Impl<Ret>>(std::ref(*f),f)
new Assignable_Proxy_Function_Impl<Ret>(
std::ref(*f),
f
)
)
); );
} }
}; };
@ -108,12 +94,7 @@ namespace chaiscript
{ {
static Boxed_Value handle(const std::shared_ptr<std::function<Ret>> &f) { static Boxed_Value handle(const std::shared_ptr<std::function<Ret>> &f) {
return Boxed_Value( return Boxed_Value(
std::shared_ptr<Proxy_Function_Base>( chaiscript::make_shared<dispatch::Proxy_Function_Base, dispatch::Assignable_Proxy_Function_Impl<Ret>>(std::ref(*f),f)
new Assignable_Proxy_Function_Impl<Ret>(
std::ref(*f),
f
)
)
); );
} }
}; };
@ -123,20 +104,14 @@ namespace chaiscript
{ {
static Boxed_Value handle(std::function<Ret> &f) { static Boxed_Value handle(std::function<Ret> &f) {
return Boxed_Value( return Boxed_Value(
std::shared_ptr<Proxy_Function_Base>( chaiscript::make_shared<dispatch::Proxy_Function_Base, dispatch::Assignable_Proxy_Function_Impl<Ret>>(std::ref(f),
new Assignable_Proxy_Function_Impl<Ret>( std::shared_ptr<std::function<Ret>>())
std::ref(f),
std::shared_ptr<std::function<Ret>>()
)
)
); );
} }
static Boxed_Value handle(const std::function<Ret> &f) { static Boxed_Value handle(const std::function<Ret> &f) {
return Boxed_Value( return Boxed_Value(
std::shared_ptr<dispatch::Proxy_Function_Base>( chaiscript::make_shared<dispatch::Proxy_Function_Base, dispatch::Proxy_Function_Impl<Ret>>(f)
new dispatch::Proxy_Function_Impl<Ret>(f)
)
); );
} }
}; };