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

@ -46,6 +46,16 @@ namespace chaiscript
return Boxed_Value(r);
}
};
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
@ -57,6 +67,11 @@ namespace chaiscript
{
return Boxed_Value(boost::ref(r));
}
static Boxed_Value handle(const Ret &r)
{
return Boxed_Value(boost::cref(r));
}
};
/**