470,849 Members | 1,132 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,849 developers. It's quick & easy.

Compiler barfing on struct with map including structure as second

#include <iostream>
#include <string>
#include <map>

struct SSkill
{
std::map< std::string, SSkill >;
float Value;
}

int main ()
{

SSkill Skills;

std::string wait;
std::cin >> wait;
}

Error is:
:\Source\working\console\test.cpp(9) : fatal error C1001: INTERNAL COMPILER
ERROR
(compiler file 'msc1.cpp', line 2701)
Please choose the Technical Support command on the Visual C++
Help menu, or open the Technical Support help file for more
information

How do I go about doing this?

What I want to wind up with is a type of map that allows indentation so to
speak.

Mystic
Unarmed
CombatReflex
HandToHand
UnarmedParry
Dodge
Disarm
Armed
CombatReflex
Swordplay
Hooligan
Artisan
Explosives
Dynamite
Caps (Bullet Shells)
Bomb
Crafting
Grenades
Detonation Blocks
Timer triggers
Sensor triggers
Manual triggers
Using
Trapping
Gathering
Herbology

etc...

I thought what I was trying would be fairly simple. A map with a
std::string as the key (of the skill name) and the Skill class itself as the
value. Then I could go through and check if it had submaps.

I'm pretty sure I can do this with pointers, I.E.
std::map< std::string, SSkill* >;
but why do I have to?
May 12 '06 #1
1 1352

"Jim Langston" <ta*******@rocketmail.com> wrote in message
news:w6***************@fe05.lga...
#include <iostream>
#include <string>
#include <map>

struct SSkill
{
std::map< std::string, SSkill >;
float Value;
}


Stupid me. I didn't give the map a name.
std::map< std::string, SSkill > Skills;
fixed it.
May 12 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Adam Warner | last post: by
6 posts views Thread by S.Tobias | last post: by
29 posts views Thread by junky_fellow | last post: by
13 posts views Thread by Chua Wen Ching | last post: by
9 posts views Thread by fabio.bizzetti | last post: by
8 posts views Thread by Chameleon | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.