Does anyone know if libstdc++
in g++ <= 4.9
is fully C++11-compliant (or claimed to be)? For example, the code below does not compile (compiles on clang):
#include <iostream>
#include <string>
using namespace std;
int main()
{
string s;
// g++4.9 bug, returns void
// instead, according to the standard N3936 21.4.6.4/21
// should return an iterator (string::iterator or wrapper)
auto x = s.insert(s.begin(), 10,'A');
cout << s << endl;
}
The overload of std::string::insert
I'm using is declared in 21.4.6.4/21 (N3936) as returning an iterator to the first character inserted
iterator insert(const_iterator p, size_type n, charT c);
however in the code above it returns void
. Is the std::string
part of the library non-compliant? I wonder if it compiles on g++4.10.