From c86e71ec09619915275b132d550070e25df52cc4 Mon Sep 17 00:00:00 2001 From: Eric Mertens Date: Mon, 4 Dec 2023 17:35:18 -0800 Subject: [PATCH] simplify --- lib/include/aocpp/Counter.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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