If there is any difference between it1 and it2?
std::set<sometype> s; auto it1 = std::inserter(s, s.begin()); auto it2 = std::inserter(s, s.end());