constexpr std::size_t checkOverflowOrNpos()

in cxx/fbjni/detail/SimpleFixedString.h [87:91]


constexpr std::size_t checkOverflowOrNpos(std::size_t i, std::size_t max) {
  return i == static_cast<std::size_t>(-1)
      ? max
      : (i <= max ? i : (void(assertOutOfBounds()), max));
}