11 Dec, 2011, Zeno wrote in the 1st comment:
Votes: 0
I'm attempting to use std::map in C++.

At the top of zone.h
#include <list>
#include <map>


Further down in zone.h (line 95):
typedef std::map<int,CBaseEntity*> EntityList_t;

(CBaseEntity is a class; if I change it to something standard like an int it'll still get the same error)

Compiling gives the error:
Quote
zone.h:95: error: expected initializer before '<' token


Now, I'm using a std::list in the file too and that doesn't have any errors.

Any thoughts? Including <map> should make it work just fine, but the include has always been in there.
11 Dec, 2011, Tyche wrote in the 2nd comment:
Votes: 0
The only time I've seen that error is when the compiler can't find the identifier in the namespace.
Like with…
typedef map<int,int> foo;
instead of…
typedef std::map<int,int> foo;
or…
using namespace std;
typedef map<int,int> foo;
12 Dec, 2011, Davion wrote in the 3rd comment:
Votes: 0
I used to get this when c/p small test snippets into rom. I used 'T' as a place holder for template types but rom had T defined as a macro for bits. Maybe you have a map macro?
13 Dec, 2011, Zeno wrote in the 4th comment:
Votes: 0
Yep, that was it! More details: http://stackoverflow.com/questions/65586...
13 Dec, 2011, Runter wrote in the 5th comment:
Votes: 0
I guess that's a macro from before using C++..?

Lol, just noticed you've had this compile problem for like half a year.
13 Dec, 2011, Davion wrote in the 6th comment:
Votes: 0
Shoulda asked here first!
0.0/6