Handle case of const & return values (should probably be investigated a bit more)

This commit is contained in:
Jason Turner 2009-11-18 04:42:43 +00:00
parent 391eaa9e11
commit 9f65303370

View File

@ -47,6 +47,16 @@ namespace chaiscript
} }
}; };
template<typename Ret>
struct Handle_Return<const Ret &>
{
static Boxed_Value handle(const Ret &r)
{
return Boxed_Value(boost::cref(r));
}
};
/** /**
* Used internally for handling a return value from a Proxy_Function call * Used internally for handling a return value from a Proxy_Function call
*/ */
@ -57,6 +67,11 @@ namespace chaiscript
{ {
return Boxed_Value(boost::ref(r)); return Boxed_Value(boost::ref(r));
} }
static Boxed_Value handle(const Ret &r)
{
return Boxed_Value(boost::cref(r));
}
}; };
/** /**