C++11 related cleanup and improvments

This commit is contained in:
Jason Turner
2014-09-15 21:16:44 -06:00
parent 6c2ccf3869
commit 5861c45fc1
5 changed files with 18 additions and 34 deletions

View File

@@ -46,13 +46,9 @@ namespace chaiscript
/// \param[in] v Boxed_Number to copy into the new object
/// \returns The newly created object.
template<typename P1>
std::shared_ptr<P1> construct_pod(Boxed_Number v)
std::shared_ptr<P1> construct_pod(const Boxed_Number &v)
{
std::shared_ptr<P1> p(new P1());
Boxed_Value bv(p);
Boxed_Number nb(bv);
nb = v;
return p;
return std::make_shared<P1>(v.get_as<P1>());
}
}