add 2015 01 and 02

This commit is contained in:
Eric Mertens
2024-06-10 11:08:30 -07:00
parent 4073ac22fc
commit c1dca9065f
6 changed files with 116 additions and 4 deletions

View File

@@ -8,7 +8,7 @@ struct Counter
{
using difference_type = std::ptrdiff_t;
struct EmptyRef {
struct NoOpReference {
template <typename T>
auto operator=(T&&) const -> void {}
};
@@ -31,14 +31,14 @@ struct Counter
return n++;
}
auto operator*() const -> EmptyRef
auto operator*() const -> NoOpReference
{
return {};
}
auto operator-(Counter rhs) const -> difference_type
{
return static_cast<difference_type>(n) - static_cast<difference_type>(rhs);
return static_cast<difference_type>(n) - static_cast<difference_type>(rhs.n);
}
operator std::size_t() const

View File

@@ -48,4 +48,4 @@ auto ParseGrammar_(G const& grammar, std::istream & in) -> typename G::start_typ
}
#endif
#endif