According to cppreference, C++11 should support:
template< class InputIt >
iterator insert( const_iterator pos, InputIt first, InputIt last );
But when I try to compile following code using g++ 4.9.2:
std::string str{ "hello world" }, addition{ "h my" };
auto iter = str.erase(str.begin(), str.begin() + 4);
iter = str.insert(next(iter), addition.begin(), addition.end()); // Error
I receive the following error (live example):
error: no match for 'operator=' (operand types are '__gnu_cxx::__normal_iterator<char*, std::basic_string<char> >' and 'void')
iter = str.insert(next(iter), addition.begin(), addition.end());
^
However, Visual Studio 2013 and Clang seem no problem.