You must specify the compiler argument -std=c++0x to avoid the following error: test.cpp:5:13: error: default template arguments may not be used in function templates without -std=c++0x or -std=gnu++0x