]> www.ginac.de Git - ginac.git/blobdiff - ginac/ex.cpp
Use C++11 range-based foor loops and auto, where possible.
[ginac.git] / ginac / ex.cpp
index ee6827aad0b144686396f3962253daf3491166b3..290154b4838e863859db143e181ea337e8ef9e75 100644 (file)
@@ -162,8 +162,7 @@ ex ex::subs(const ex & e, unsigned options) const
                // Argument is a list: convert it to a map
                exmap m;
                GINAC_ASSERT(is_a<lst>(e));
-               for (lst::const_iterator it = ex_to<lst>(e).begin(); it != ex_to<lst>(e).end(); ++it) {
-                       ex r = *it;
+               for (auto & r : ex_to<lst>(e)) {
                        if (!r.info(info_flags::relation_equal))
                                throw(std::invalid_argument("basic::subs(ex): argument must be a list of equations"));
                        const ex & s = r.op(0);
@@ -243,8 +242,8 @@ bool ex::is_polynomial(const ex & vars) const
 {
        if (is_a<lst>(vars)) {
                const lst & varlst = ex_to<lst>(vars);
-               for (lst::const_iterator i=varlst.begin(); i!=varlst.end(); ++i)
-                       if (!bp->is_polynomial(*i))
+               for (auto & it : varlst)
+                       if (!bp->is_polynomial(it))
                                return false;
                return true;
        }