new std::vector::insert

51 views
Skip to first unread message

Daniel Cooke

unread,
Feb 17, 2015, 12:22:21 PM2/17/15
to std-pr...@isocpp.org
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.
Reply all
Reply to author
Forward
0 new messages