Skip to content

Instantly share code, notes, and snippets.

@solicomo
Last active August 29, 2015 14:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save solicomo/dfea5971de9b38631e80 to your computer and use it in GitHub Desktop.
Save solicomo/dfea5971de9b38631e80 to your computer and use it in GitHub Desktop.
#include <string>
#include <typeinfo>
#include <iostream>
int main()
{
std::string s1("mark "), s2("liu");
auto iter = s1.end();
std::cout << "iter is a " << typeid(iter).name() << std::endl;
std::cout << "void is a " << typeid(void).name() << std::endl;
auto iter1 = s1.insert(s1.end(), s2.begin(), s2.end()); // error for g++
std::cout << "iter1 is a " << typeid(iter1).name() << std::endl; // error for g++
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment