r.second >= range.second && r.second <= range.second
Isn't that ==

Or then intended something else.