Skip to main content
GameDev.net gamedev.net
🔒 Locked

STL multimap

Started by Soulkeeper Oct 30, 2002 at 1:31 PM 3 replies 850+ views
Original Post
Soulkeeper
Soulkeeper
I'm working on a project and I want to typedef multimap to a shorter name. So, I do this...
  
typedef multimap<WORD, Records*, greater<WORD>> RECORD_MAP;
  
Records* is a pointer to a struct but then the compiler likes to complain that it can't do that because I'm missing a ',' somewhere and that there's no type after the multimap so it just ignores that. Here are the errors/warnings it gives me:
      
error C2146: syntax error : missing ',' before identifier 'RECORD_MAP'
error C2065: 'RECORD_MAP' : undeclared identifier
error C2143: syntax error : missing '>' before ';'
warning C4091: 'typedef ' : ignored on left of 'class std::multimap' when no variable is declared
      
Any help in getting this to work would be appreciated. I'm learning, just like the best of us... Ok, now assume a spherical cow... [edited by - Soulkeeper on October 30, 2002 2:32:31 PM] [edited by - Soulkeeper on October 30, 2002 2:32:52 PM]
I'm learning, just like the best of us...Ok, now assume a spherical cow... :)
dMDI
dMDI

  <greater>>   
is wrong. The compiler is trying to interpret it as a shift right operator. Put a space, like this:

  <greater> >   


[edited by - dMDI on October 30, 2002 2:42:08 PM]

[edited by - dMDI on October 30, 2002 2:43:24 PM]
"I don''t know with what weapons the third world war will be fought, but I know the fourth will be fought with sticks and stones." Einstein
dMDI
dMDI
FFS, my post looks ugly, writing it normally and with code tags didnt display it correctly, now I have a pair of massive boxes in it to ever allow me to reply.
"I don''t know with what weapons the third world war will be fought, but I know the fourth will be fought with sticks and stones." Einstein
civguy
civguy
You do this (that is, use & g t ; and & l t ; without the spaces)
<greater> > 


[edited by - civguy on October 30, 2002 3:29:19 PM]
Soulkeeper
Soulkeeper
LOL, that was a funny mistake I made. Gosh, it was so obvious also. Thanks a lot.
I'm learning, just like the best of us...Ok, now assume a spherical cow... :)

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.