We cannot use a lambda here, as lambdas are non assignable, and the set operations below require moving the comparators around.
| 1502 | // We cannot use a lambda here, as lambdas are non assignable, and the set operations |
| 1503 | // below require moving the comparators around. |
| 1504 | struct Comp { |
| 1505 | const Ctx* ctx_ptr; |
| 1506 | Comp(const Ctx& ctx) : ctx_ptr(&ctx) {} |
| 1507 | bool operator()(const Key& a, const Key& b) const { return ctx_ptr->KeyCompare(a, b); } |
| 1508 | }; |
| 1509 | |
| 1510 | // state in the recursive computation: |
| 1511 | // - std::nullopt means "this node has duplicates" |