Handle return of std::unique_ptr objects
This commit is contained in:
parent
2ce155237d
commit
1cb15d8b22
@ -27,9 +27,7 @@ namespace chaiscript
|
|||||||
|
|
||||||
namespace detail
|
namespace detail
|
||||||
{
|
{
|
||||||
/**
|
/// Used internally for handling a return value from a Proxy_Function call
|
||||||
* Used internally for handling a return value from a Proxy_Function call
|
|
||||||
*/
|
|
||||||
template<typename Ret>
|
template<typename Ret>
|
||||||
struct Handle_Return
|
struct Handle_Return
|
||||||
{
|
{
|
||||||
@ -155,6 +153,18 @@ namespace chaiscript
|
|||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
template<typename Ret>
|
||||||
|
struct Handle_Return<std::unique_ptr<Ret>> : Handle_Return<std::unique_ptr<Ret> &>
|
||||||
|
{
|
||||||
|
static Boxed_Value handle(std::unique_ptr<Ret> &&r)
|
||||||
|
{
|
||||||
|
return Boxed_Value(std::move(r), true);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
template<typename Ret>
|
template<typename Ret>
|
||||||
struct Handle_Return<const Ret &>
|
struct Handle_Return<const Ret &>
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user