...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Returns a new sequence with another sequence inserted at a specified iterator.
template< typename Sequence, typename Pos, typename Range > typename result_of::insert_range<Sequence const, Pos, Range>::type insert_range( Sequence const& seq, Pos const& pos, Range const& range);
Table 1.66. Parameters
Parameter |
Requirement |
Description |
---|---|---|
seq |
A model of Forward Sequence |
Operation's argument |
pos |
A model of Forward Iterator |
The position to insert at |
range |
A model of Forward Sequence |
Range to insert |
insert(seq, pos, range);
Return type: A model of Forward Sequence.
Semantics: Returns a new sequence, containing all the elements of seq, and the elements of range inserted at iterator pos. All elements retaining their ordering from the orignal sequences.
Constant. Returns a view which is lazily evaluated.
#include <boost/fusion/algorithm/transformation/insert_range.hpp> #include <boost/fusion/include/insert_range.hpp>
const vector<int,int> vec(1,2); assert(insert_range(vec, next(begin(vec)), make_vector(3,4)) == make_vector(1,3,4,2));