Attempt to create the concept of "return values"

to reduce clones of values. This doesn't quite work
This commit is contained in:
Jason Turner
2015-04-07 13:54:38 -06:00
parent 5114ca9d35
commit 1f74bfd9b3
4 changed files with 56 additions and 31 deletions

View File

@@ -569,7 +569,12 @@ namespace chaiscript
lhs.assign(rhs);
return rhs;
} else {
rhs = t_ss.call_function("clone", rhs);
if (!rhs.is_return_value())
{
rhs = t_ss.call_function("clone", rhs);
} else {
rhs.reset_return_value();
}
}
}