including a std::map within a struct? Is it ok?

Posted by user553514 on Stack Overflow See other posts from Stack Overflow or by user553514
Published on 2011-01-13T21:46:38Z Indexed on 2011/01/13 21:53 UTC
Read the original article Hit count: 122

Filed under:
|
|
class X_class{
public:

struct extra
{int extra1;
 int extra2;
 int extra3;
};
enum a
{
 n,m};

struct x_struct{
char b;
char c;
int d;
int e;
std::map <int, extra> myExtraMap;

};
};

in my code I define :

x_struct myStruct;

why do I get compile errors compiling the above class? The error either says: 1) expected ; before < on the line --- where I defined the map (above) if I eliminate std:: or 2) error: invalid use of ::; error: expected ; before < token

© Stack Overflow or respective owner

Related posts about c++

Related posts about stl