Use maximum category in sketch. (#7853)

This commit is contained in:
Jiaming Yuan
2022-05-05 19:56:49 +08:00
committed by GitHub
parent 8ab5e13b5d
commit 46e0bce212
6 changed files with 117 additions and 78 deletions

View File

@@ -188,10 +188,17 @@ class IndexTransformIter {
*/
explicit IndexTransformIter(Fn &&op) : fn_{op} {}
IndexTransformIter(IndexTransformIter const &) = default;
IndexTransformIter& operator=(IndexTransformIter&&) = default;
IndexTransformIter& operator=(IndexTransformIter const& that) {
iter_ = that.iter_;
return *this;
}
value_type operator*() const { return fn_(iter_); }
auto operator-(IndexTransformIter const &that) const { return iter_ - that.iter_; }
bool operator==(IndexTransformIter const &that) const { return iter_ == that.iter_; }
bool operator!=(IndexTransformIter const &that) const { return !(*this == that); }
IndexTransformIter &operator++() {
iter_++;