simplify
This commit is contained in:
parent
ceab9a14cc
commit
c86e71ec09
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user