Skip to content

Instantly share code, notes, and snippets.

@keisukefukuda
Created September 24, 2013 19:16
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 keisukefukuda/6689841 to your computer and use it in GitHub Desktop.
Save keisukefukuda/6689841 to your computer and use it in GitHub Desktop.
Compiler compatibility test
#include <map>
#include <string>
using namespace std;
// This is OK.
void func(map<string,string> a=map<string,string>()) {
return;
}
// This is bad.
class Foo {
void bar(map<string,string> a=map<string,string>()) {
return;
}
};
int main(int argc, char **argv) {
Foo foo;
return 0;
}
@keisukefukuda
Copy link
Author

Works with Linux g++

$ g++ --version
g++ (GCC) 4.4.5 20110214 (Red Hat 4.4.5-6)
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment