aboutsummaryrefslogtreecommitdiff
path: root/src/2016/day1/aoc.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/2016/day1/aoc.h')
-rw-r--r--src/2016/day1/aoc.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/2016/day1/aoc.h b/src/2016/day1/aoc.h
index 66e97d1..d378d3b 100644
--- a/src/2016/day1/aoc.h
+++ b/src/2016/day1/aoc.h
@@ -53,8 +53,8 @@ struct position {
}
position move(const std::vector<instruction>& is) const noexcept {
- position next;
- std::for_each(is.begin(), is.end(), [&next, this](const instruction& i) { next = move(i); });
+ position next = *this;
+ std::for_each(is.begin(), is.end(), [&next](const instruction& i) { next = next.move(i); });
return next;
}
};