X
Xenos
I have elements of vector I need to add to a set. Can I just do (ignoring
namespace):
copy(v.begin(), v.end(), inserter(s, s.end()));
Where, v is a vector and s is a set, and both have the same value_type.
I'm worried about the iterator required by inserter, and thus insert. I
know a map will just use the iterator as a hint, and still place the items
in the proper order. Will set also do this, or will my above call mess up
the ordering?
Thanks,
DrX
namespace):
copy(v.begin(), v.end(), inserter(s, s.end()));
Where, v is a vector and s is a set, and both have the same value_type.
I'm worried about the iterator required by inserter, and thus insert. I
know a map will just use the iterator as a hint, and still place the items
in the proper order. Will set also do this, or will my above call mess up
the ordering?
Thanks,
DrX