My C ++ is a little rusty, so ...
#include<list> typedef list<int> foo;
which gives me a good error message:
test.cpp: 2: syntax error before `; 'Marker
What the heck can I even google this ...
The list is expected to be in the global namespace. But it is defined inside the std namespace. Hence, either you must use using namespace std; or explicitly specify the namespace as std::list; . I personally prefer the second option.
using namespace std;
std::list;
C++ Standard library names are in namespacestd
C++
std
#include <list> typedef std::list<int> foo;
list<> is in the STD namespace. This should work fine:
list<>
#include<list> typedef std::list<int> foo;
Alternatively, you can do,
#include<list> using namespace std; typedef list<int> foo;
if you don't want to type std:: everywhere.
std::