diff options
author | kaiwu <kaiwu2004@gmail.com> | 2022-04-03 17:43:44 +0800 |
---|---|---|
committer | kaiwu <kaiwu2004@gmail.com> | 2022-04-03 17:43:44 +0800 |
commit | 3ff3329e83a7c02be67dac2610ca7a85d5a7d455 (patch) | |
tree | 13aa2c133c47fd89913627c88c77f5d54e47ae8c /src/2016/day1/aoc.h | |
parent | 86eb9400ed2793b42ced77e7ee68100a487ffd20 (diff) | |
download | advent-of-code-3ff3329e83a7c02be67dac2610ca7a85d5a7d455.tar.gz advent-of-code-3ff3329e83a7c02be67dac2610ca7a85d5a7d455.zip |
subsequent moves
Diffstat (limited to 'src/2016/day1/aoc.h')
-rw-r--r-- | src/2016/day1/aoc.h | 4 |
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; } }; |