Standard C++ Library User Guide and Tutorial

merge (aVec.begin(), aVec.end(), aList.begin(), aList.end(),
inserter(lResult, lResult.begin()));
// merge into the output
merge (aVec.begin(), aVec.end(), aList.begin(), aList.end(),
ostream_iterator<int> (cout, " "));
cout << endl;
}
The algorithm inplace_merge() (Section 13 Merge Two Adjacent Sequences into One) can be used to
merge two sections of a single sequence into one sequence.