- auto *CU = std::upper_bound(this->begin(), this->end(), Offset,
- UnitOffsetComparator());
+ auto *CU = std::upper_bound(
+ this->begin(), this->end(), Offset,
+ [](uint32_t LHS, const std::unique_ptr<UnitType> &RHS) {
+ return LHS < RHS->getNextUnitOffset();
+ });