diff options
Diffstat (limited to 'src/constrain.cpp')
-rw-r--r-- | src/constrain.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/constrain.cpp b/src/constrain.cpp index baa4ca8..2a3c8fe 100644 --- a/src/constrain.cpp +++ b/src/constrain.cpp @@ -154,9 +154,9 @@ constrain_fn(TEnv& tenv, Constraints& c, const ATuple* call) throw(Error) // Add parameters to environment frame List protT; - FOREACHP(ATuple::const_iterator, i, call->prot()) { - const ASymbol* sym = (*i)->to_symbol(); - THROW_IF(!sym, (*i)->loc, "parameter name is not a symbol"); + for (const auto& i : *call->prot()) { + const ASymbol* sym = i->to_symbol(); + THROW_IF(!sym, i->loc, "parameter name is not a symbol"); THROW_IF(defs.count(sym) != 0, sym->loc, (format("duplicate parameter `%1%'") % sym->str()).str()); defs.insert(sym); @@ -312,8 +312,8 @@ resp_constrain_quoted(TEnv& tenv, Constraints& c, const AST* ast) throw(Error) c.constrain(tenv, ast, tupT); c.constrain(tenv, tup->fst(), fstT); - FOREACHP(ATuple::const_iterator, i, ast->as_tuple()) { - resp_constrain_quoted(tenv, c, *i); + for (const auto& i : *ast->as_tuple()) { + resp_constrain_quoted(tenv, c, i); } } else { @@ -335,8 +335,8 @@ constrain_call(TEnv& tenv, Constraints& c, const ATuple* call) throw(Error) { const AST* const head = call->fst(); - for (ATuple::const_iterator i = call->begin(); i != call->end(); ++i) - resp_constrain(tenv, c, *i); + for (auto i : *call) + resp_constrain(tenv, c, i); const AST* fnType = tenv.var(head); if (!AType::is_var(fnType)) { |