I know that when we are using template inside another template, we should write it like this:
vector
and if we wr
Avoid this error by setting an appropriate C++ dialect. For example, with gcc 4.9 the following file does not compile with g++:
#include
#include
int main()
{
using namespace std;
vector> v; // compile error!
return 0;
}
Let's get to the bottom of things:
#include
int main()
{
std::cout << __cplusplus << std::endl;
return 0;
}
Compiled with just g++ test.cpp this code prints 199711. Although gcc 4.9 was released in 2014 the default C++ dialect is C++98 with GNU extensions. C++98 requires us to write vector. If you like vector more compile with -std=c++11 or -std=gnu++11.