I think it would be useful, from a user perspective, but also potentially from a performance perspective, to allow for a unary operator parameter in
std::vector::insert. I have recently posed two questions on SO addressing this issue (see
here, and
here).
The form of the function should be:
template <class InputIterator, class UnaryOperation>
iterator insert (const_iterator position, InputIterator first, InputIterator last, UnaryOperation op);
While it is not clear to me if this would have any significant performance advantage over the methods discussed on SO, it would in-any-case remove uncertainty of cost.