including a std::map within a struct? Is it ok?
- by user553514
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