mirror of
https://github.com/ChaiScript/ChaiScript.git
synced 2026-02-07 10:19:57 +08:00
New fix for C2131: expression did not evaluate to a constant.
Some subexpresion do not evaluate to a constexpr due to the nature of the object. So instead of a compile time expr they have been changed to const.
This commit is contained in:
parent
359a7d87c1
commit
3df26129ff
@ -1303,8 +1303,8 @@ namespace chaiscript
|
|||||||
const auto lhssize = lhsparamtypes.size();
|
const auto lhssize = lhsparamtypes.size();
|
||||||
const auto rhssize = rhsparamtypes.size();
|
const auto rhssize = rhsparamtypes.size();
|
||||||
|
|
||||||
constexpr auto const boxed_type = user_type<Boxed_Value>();
|
auto const boxed_type = user_type<Boxed_Value>();
|
||||||
constexpr auto const boxed_pod_type = user_type<Boxed_Number>();
|
auto const boxed_pod_type = user_type<Boxed_Number>();
|
||||||
|
|
||||||
for (size_t i = 1; i < lhssize && i < rhssize; ++i)
|
for (size_t i = 1; i < lhssize && i < rhssize; ++i)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -77,7 +77,7 @@ namespace chaiscript
|
|||||||
std::vector<Boxed_Value> convert(Function_Params t_params, const Type_Conversions_State &t_conversions) const
|
std::vector<Boxed_Value> convert(Function_Params t_params, const Type_Conversions_State &t_conversions) const
|
||||||
{
|
{
|
||||||
auto vals = t_params.to_vector();
|
auto vals = t_params.to_vector();
|
||||||
constexpr const auto dynamic_object_type_info = user_type<Dynamic_Object>();
|
const auto dynamic_object_type_info = user_type<Dynamic_Object>();
|
||||||
for (size_t i = 0; i < vals.size(); ++i)
|
for (size_t i = 0; i < vals.size(); ++i)
|
||||||
{
|
{
|
||||||
const auto &name = m_types[i].first;
|
const auto &name = m_types[i].first;
|
||||||
@ -117,7 +117,7 @@ namespace chaiscript
|
|||||||
// second result: needs conversions
|
// second result: needs conversions
|
||||||
std::pair<bool, bool> match(const Function_Params &vals, const Type_Conversions_State &t_conversions) const noexcept
|
std::pair<bool, bool> match(const Function_Params &vals, const Type_Conversions_State &t_conversions) const noexcept
|
||||||
{
|
{
|
||||||
constexpr const auto dynamic_object_type_info = user_type<Dynamic_Object>();
|
const auto dynamic_object_type_info = user_type<Dynamic_Object>();
|
||||||
bool needs_conversion = false;
|
bool needs_conversion = false;
|
||||||
|
|
||||||
if (!m_has_types) { return std::make_pair(true, needs_conversion); }
|
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
|
static bool compare_type_to_param(const Type_Info &ti, const Boxed_Value &bv, const Type_Conversions_State &t_conversions) noexcept
|
||||||
{
|
{
|
||||||
constexpr const auto boxed_value_ti = user_type<Boxed_Value>();
|
const auto boxed_value_ti = user_type<Boxed_Value>();
|
||||||
constexpr const auto boxed_number_ti = user_type<Boxed_Number>();
|
const auto boxed_number_ti = user_type<Boxed_Number>();
|
||||||
constexpr const auto function_ti = user_type<std::shared_ptr<const Proxy_Function_Base>>();
|
const auto function_ti = user_type<std::shared_ptr<const Proxy_Function_Base>>();
|
||||||
|
|
||||||
if (ti.is_undef()
|
if (ti.is_undef()
|
||||||
|| ti.bare_equal(boxed_value_ti)
|
|| ti.bare_equal(boxed_value_ti)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user