diff --git a/exprtk.hpp b/exprtk.hpp index 256eb17..56ce801 100644 --- a/exprtk.hpp +++ b/exprtk.hpp @@ -283,6 +283,11 @@ namespace exprtk return result; } + inline std::string to_str(std::size_t i) + { + return to_str(static_cast(i)); + } + inline bool is_hex_digit(const std::string::value_type digit) { return (('0' <= digit) && (digit <= '9')) || @@ -35715,9 +35720,7 @@ namespace exprtk { scoped_bft sb(*this); base_func::update(v0); - T result = this->value(base_func::expression); - - return result; + return this->value(base_func::expression); } }; @@ -35731,9 +35734,7 @@ namespace exprtk { scoped_bft sb(*this); base_func::update(v0, v1); - T result = this->value(base_func::expression); - - return result; + return this->value(base_func::expression); } }; @@ -35747,9 +35748,7 @@ namespace exprtk { scoped_bft sb(*this); base_func::update(v0, v1, v2); - T result = this->value(base_func::expression); - - return result; + return this->value(base_func::expression); } }; @@ -35763,9 +35762,7 @@ namespace exprtk { scoped_bft sb(*this); base_func::update(v0, v1, v2, v3); - T result = this->value(base_func::expression); - - return result; + return this->value(base_func::expression); } }; @@ -35779,9 +35776,7 @@ namespace exprtk { scoped_bft sb(*this); base_func::update(v0, v1, v2, v3, v4); - T result = this->value(base_func::expression); - - return result; + return this->value(base_func::expression); } }; @@ -35795,9 +35790,7 @@ namespace exprtk { scoped_bft sb(*this); base_func::update(v0, v1, v2, v3, v4, v5); - T result = this->value(base_func::expression); - - return result; + return this->value(base_func::expression); } }; @@ -35844,8 +35837,6 @@ namespace exprtk const Sequence& var_list, const bool override = false) { - const std::size_t n = var_list.size(); - const typename std::map::iterator itr = expr_map_.find(name); if (expr_map_.end() != itr) @@ -35863,6 +35854,8 @@ namespace exprtk if (compile_expression(name,expression,var_list)) { + const std::size_t n = var_list.size(); + fp_map_[n][name]->setup(expr_map_[name]); return true; @@ -35928,7 +35921,7 @@ namespace exprtk inline bool add(const function& f, const bool override = false) { - return add(f.name_,f.expression_,f.v_,override); + return add(f.name_, f.expression_, f.v_,override); } private: diff --git a/exprtk_simple_example_04.cpp b/exprtk_simple_example_04.cpp index 7cf9393..801feae 100644 --- a/exprtk_simple_example_04.cpp +++ b/exprtk_simple_example_04.cpp @@ -70,7 +70,7 @@ void fibonacci() for (std::size_t i = 0; i < 40; ++i) { - x = i; + x = static_cast(i); T result = expression.value(); diff --git a/exprtk_simple_example_09.cpp b/exprtk_simple_example_09.cpp index 469c910..5f68703 100644 --- a/exprtk_simple_example_09.cpp +++ b/exprtk_simple_example_09.cpp @@ -130,7 +130,7 @@ void primes() for (std::size_t i = 0; i < 100; ++i) { - x = i; + x = static_cast(i); T result1 = expression1.value(); T result2 = expression2.value(); diff --git a/exprtk_simple_example_10.cpp b/exprtk_simple_example_10.cpp index 43cb0b1..9a2e4c1 100644 --- a/exprtk_simple_example_10.cpp +++ b/exprtk_simple_example_10.cpp @@ -72,7 +72,7 @@ void newton_sqrt() for (std::size_t i = 0; i < 100; ++i) { - x = i; + x = static_cast(i); T result = expression.value();