I guess this is a simple question. I need to do something like this:
std::set s1, s2;
s1 = getAnExcitingSet();
std::transform(s1.begin(), s1.end()
In 2016 there was a proposal to have a "single argument inserter iterator".
https://isocpp.org/files/papers/p0471r0.html . I couldn't find if it the proposal advanced. I think it makes sense.
For now you can have this behavior defining the maker function:
template
auto sinserter(Container& c){
using std::end;
return std::inserter(c, end(c));
}
Used as:
std::transform(begin(my_vec), end(my_vec), sinserter(my_set), [](auto& e){return e.member;});