Fix for C2131: expression did not evaluate to a constant.

This commit is contained in:
Jose Rubio 2020-01-13 13:11:45 +01:00
parent 84df5918ce
commit 359a7d87c1
2 changed files with 7 additions and 7 deletions

View File

@ -1303,8 +1303,8 @@ namespace chaiscript
const auto lhssize = lhsparamtypes.size();
const auto rhssize = rhsparamtypes.size();
constexpr const auto boxed_type = user_type<Boxed_Value>();
constexpr const auto boxed_pod_type = user_type<Boxed_Number>();
constexpr auto const boxed_type = user_type<Boxed_Value>();
constexpr auto const boxed_pod_type = user_type<Boxed_Number>();
for (size_t i = 1; i < lhssize && i < rhssize; ++i)
{

View File

@ -77,7 +77,7 @@ namespace chaiscript
std::vector<Boxed_Value> convert(Function_Params t_params, const Type_Conversions_State &t_conversions) const
{
auto vals = t_params.to_vector();
constexpr auto dynamic_object_type_info = user_type<Dynamic_Object>();
constexpr const auto dynamic_object_type_info = user_type<Dynamic_Object>();
for (size_t i = 0; i < vals.size(); ++i)
{
const auto &name = m_types[i].first;
@ -117,7 +117,7 @@ namespace chaiscript
// second result: needs conversions
std::pair<bool, bool> match(const Function_Params &vals, const Type_Conversions_State &t_conversions) const noexcept
{
constexpr auto dynamic_object_type_info = user_type<Dynamic_Object>();
constexpr const auto dynamic_object_type_info = user_type<Dynamic_Object>();
bool needs_conversion = false;
if (!m_has_types) { return std::make_pair(true, needs_conversion); }
@ -252,9 +252,9 @@ namespace chaiscript
static bool compare_type_to_param(const Type_Info &ti, const Boxed_Value &bv, const Type_Conversions_State &t_conversions) noexcept
{
constexpr auto boxed_value_ti = user_type<Boxed_Value>();
constexpr auto boxed_number_ti = user_type<Boxed_Number>();
constexpr auto function_ti = user_type<std::shared_ptr<const Proxy_Function_Base>>();
constexpr const auto boxed_value_ti = user_type<Boxed_Value>();
constexpr const auto boxed_number_ti = user_type<Boxed_Number>();
constexpr const auto function_ti = user_type<std::shared_ptr<const Proxy_Function_Base>>();
if (ti.is_undef()
|| ti.bare_equal(boxed_value_ti)