In that case the first half of this method will not find a single valid non-closed interval, and so i.begin() is invalid here.