J
Jim Langston
I normally do my own iterations using containers, but have been striving to
learn the standard algorithms and use them. One one point in my code I
simply want to elements from one set into another. This is what I was able
to piece together copying the elements from std::set<size_t> Triangles to
std::set<size_t> SelectedSet:
std::copy( Triangles.begin(), Triangles.end(),
std::insert_iterator<std::set<size_t> >( SelectedSet,
SelectedSet.begin() ) );
std::insert_iterator<std::set<size_t> >( SelectedSet, SelectedSet.begin() )
is a mouthful. Is there a simpler way?
learn the standard algorithms and use them. One one point in my code I
simply want to elements from one set into another. This is what I was able
to piece together copying the elements from std::set<size_t> Triangles to
std::set<size_t> SelectedSet:
std::copy( Triangles.begin(), Triangles.end(),
std::insert_iterator<std::set<size_t> >( SelectedSet,
SelectedSet.begin() ) );
std::insert_iterator<std::set<size_t> >( SelectedSet, SelectedSet.begin() )
is a mouthful. Is there a simpler way?