>>15
>処理したい範囲は [ a , b ) とする。
それなら、
for ( set<int>::iteretor itr1 = i.lower_bound( a ) ; itr1 != i.lower_bound( b ) ; itr1++ ){
じゃないか?