Compiler barfing on struct with map including structure as second

J

Jim Langston

#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?
 
J

Jim Langston

Jim Langston said:
#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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,231
Members
46,820
Latest member
GilbertoA5

Latest Threads

Top