Comment by TeMPOraL

4 years ago

Well, in C++, it would read:

  int target;
  sscanf(json+offset, "%d", &target)

Where str_t's operator+ would look roughly like:

  str_t str_t::operator+(size_t offset) {
    return str_t{size - offset, ptr + offset};
  }

(Might look exactly like this, if str_t's constructor would throw if size was negative.)