473,396 Members | 1,917 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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 1435

"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Adam Warner | last post by:
Hi all, When adding variable length arrays to my program I created the elements as type struct o *. This is because /most/ of the time the VLAs contains pointers to struct o objects (these...
6
by: S.Tobias | last post by:
I'm trying to understand how structure type completion works. # A structure or union type of unknown # content (as described in 6.7.2.3) is an incomplete type. It # is ...
29
by: junky_fellow | last post by:
Consider the following piece of code: struct junk { int i_val; int i_val1; char c_val; }; int main(void) {
13
by: Chua Wen Ching | last post by:
Hi there, I saw this article here in vb.net. http://www.error-bank.com/microsoft.public.dotnet.languages.vb.1/148992_Thread.aspx and ...
3
by: Chris | last post by:
I m trying to create a C++ managed class to use it in C#. I m new to MC++ and interoperability and I try to find a bug since a long time without succes, maybe you can help me ? (I have a sample...
9
by: fabio.bizzetti | last post by:
Hello all, I went across what seems possibly a bug of the compiler (VisualC 2005, just for the record) or a very strange and non-expected (by me at least) behaviour of the C++ ISO standard. Thus...
3
by: vduber6er | last post by:
Lets say I have this structure: typedef struct numbers { double first = 0.0; double second = 0.0; double third = 0.0; } MYVALUES; and I initialize an array of MYVALUES like the following
8
by: Chameleon | last post by:
I have a TGA image header struct. TGA has 18 bytes header, so the C struct too. why this return 20? sizeof(TGAHeader) I saw this in many structs. I believe compiler round up the size to 4...
43
by: JohnQ | last post by:
Are a default constructor, destructor, copy constructor and assignment operator generated by the compiler for a struct if they are not explicitely defined? I think the answer is yes, because...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.