diff --git a/lib/include/aocpp/Counter.hpp b/lib/include/aocpp/Counter.hpp index a23dace..98ca576 100644 --- a/lib/include/aocpp/Counter.hpp +++ b/lib/include/aocpp/Counter.hpp @@ -18,17 +18,17 @@ struct Counter Counter() : n{0} {} Counter(std::size_t n) : n{n} {} + // prefix increment auto operator++() -> Counter& { n++; return *this; } + // postfix increment auto operator++(int) -> Counter { - auto temp = *this; - n++; - return temp; + return n++; } auto operator*() const -> EmptyRef