Applied solution sent by SG-Skril here: https://github.com/ChaiScript/ChaiScript/issues/481
This commit is contained in:
Dariusz Pyś 2019-11-10 00:46:22 +01:00 committed by GitHub
parent a7dae37a23
commit a3c033d1db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -41,7 +41,7 @@ namespace chaiscript
Ret call(const Function_Params &params, const Type_Conversions_State &t_state) Ret call(const Function_Params &params, const Type_Conversions_State &t_state)
{ {
if constexpr (std::is_arithmetic_v<Ret>) { if constexpr (std::is_arithmetic_v<Ret> && !std::is_same_v<std::remove_reference_t<std::remove_cv_t<Ret>>, bool>) {
return Boxed_Number(dispatch::dispatch(m_funcs, params, t_state)).get_as<Ret>(); return Boxed_Number(dispatch::dispatch(m_funcs, params, t_state)).get_as<Ret>();
} else if constexpr (std::is_same_v<void, Ret>) { } else if constexpr (std::is_same_v<void, Ret>) {
dispatch::dispatch(m_funcs, params, t_state); dispatch::dispatch(m_funcs, params, t_state);