Fix some boxed_cast and exception issues

This commit is contained in:
Jason Turner
2016-04-14 12:03:55 -06:00
parent 720395e47a
commit 49dfdfd15a
6 changed files with 19 additions and 17 deletions

View File

@@ -424,10 +424,10 @@ namespace chaiscript
/// \brief casts an object while applying any Dynamic_Conversion available
template<typename Type>
auto boxed_cast(const Boxed_Value &bv) const -> decltype(chaiscript::boxed_cast<Type>(bv, nullptr))
decltype(auto) boxed_cast(const Boxed_Value &bv) const
{
Type_Conversions_State state(m_conversions, m_conversions.conversion_saves());
return chaiscript::boxed_cast<Type>(bv, &state);
return(chaiscript::boxed_cast<Type>(bv, &state));
}
/// Add a new conversion for upcasting to a base class