aboutsummaryrefslogtreecommitdiff
path: root/src/nix-instantiate/nix-instantiate.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/nix-instantiate/nix-instantiate.cc')
-rw-r--r--src/nix-instantiate/nix-instantiate.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/nix-instantiate/nix-instantiate.cc b/src/nix-instantiate/nix-instantiate.cc
index bea04180e..b6845197e 100644
--- a/src/nix-instantiate/nix-instantiate.cc
+++ b/src/nix-instantiate/nix-instantiate.cc
@@ -45,8 +45,8 @@ void processExpr(EvalState & state, const Strings & attrPaths,
Value vRoot;
state.eval(e, vRoot);
- foreach (Strings::const_iterator, i, attrPaths) {
- Value & v(*findAlongAttrPath(state, *i, autoArgs, vRoot));
+ for (auto & i : attrPaths) {
+ Value & v(*findAlongAttrPath(state, i, autoArgs, vRoot));
state.forceValue(v);
PathSet context;
@@ -67,11 +67,11 @@ void processExpr(EvalState & state, const Strings & attrPaths,
} else {
DrvInfos drvs;
getDerivations(state, v, "", autoArgs, drvs, false);
- foreach (DrvInfos::iterator, i, drvs) {
- Path drvPath = i->queryDrvPath();
+ for (auto & i : drvs) {
+ Path drvPath = i.queryDrvPath();
/* What output do we want? */
- string outputName = i->queryOutputName();
+ string outputName = i.queryOutputName();
if (outputName == "")
throw Error(format("derivation ‘%1%’ lacks an ‘outputName’ attribute ") % drvPath);
@@ -168,9 +168,9 @@ int main(int argc, char * * argv)
if (attrPaths.empty()) attrPaths.push_back("");
if (findFile) {
- foreach (Strings::iterator, i, files) {
- Path p = state.findFile(*i);
- if (p == "") throw Error(format("unable to find ‘%1%’") % *i);
+ for (auto & i : files) {
+ Path p = state.findFile(i);
+ if (p == "") throw Error(format("unable to find ‘%1%’") % i);
std::cout << p << std::endl;
}
return;