This commit is contained in:
Eric Mertens 2023-12-04 17:35:18 -08:00
parent ceab9a14cc
commit c86e71ec09

View File

@ -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