X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?a=blobdiff_plain;f=ginac%2Fex.cpp;h=290154b4838e863859db143e181ea337e8ef9e75;hb=052e9928511dd77d1d5d489b2a61b75579cc44e3;hp=acdb377dbf147a68535b8d2219cce02422fadb23;hpb=67edef78ce992a8f6ad704bfac228b8dec6eacd2;p=ginac.git diff --git a/ginac/ex.cpp b/ginac/ex.cpp index acdb377d..290154b4 100644 --- a/ginac/ex.cpp +++ b/ginac/ex.cpp @@ -3,7 +3,7 @@ * Implementation of GiNaC's light-weight expression handles. */ /* - * GiNaC Copyright (C) 1999-2010 Johannes Gutenberg University Mainz, Germany + * GiNaC Copyright (C) 1999-2015 Johannes Gutenberg University Mainz, Germany * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -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(e)); - for (lst::const_iterator it = ex_to(e).begin(); it != ex_to(e).end(); ++it) { - ex r = *it; + for (auto & r : ex_to(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); @@ -203,7 +202,7 @@ void ex::traverse_postorder(visitor & v) const accept(v); } -/** Return modifyable operand/member at position i. */ +/** Return modifiable operand/member at position i. */ ex & ex::let_op(size_t i) { makewriteable(); @@ -243,8 +242,8 @@ bool ex::is_polynomial(const ex & vars) const { if (is_a(vars)) { const lst & varlst = ex_to(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; }