Projectitis
Well-known member
Hi all,
I have these defs:
And in the class I am trying to define a static member of type GUIIconAllParts like this:
The compile error I get is:
Where am I going wrong?
I have these defs:
Code:
enum class GUIIconType {
none = 0,
check,
checkCircle,
close,
closeCircle
};
typedef struct {
uint32_t index;
int8_t ox;
int8_t oy;
BitmapRotation r;
} GUIIconPart;
typedef struct {
uint8_t len;
GUIIconPart parts[];
} GUIIconParts;
typedef std::map<GUIIconType,GUIIconParts> GUIIconAllParts;
And in the class I am trying to define a static member of type GUIIconAllParts like this:
Code:
static const GUIIconAllParts iconParts = {
{ GUIIconType::checkCircle, // GUIIconType
{ 2, // GUIIconParts.len
{ // GUIIconParts.parts
{ 1, 0, 0, BitmapRotation::none }, // GUIIconPart
{ 30, 0, 0, BitmapRotation::none } // GUIIconPart
}
}
}
};
The compile error I get is:
Code:
error: in-class initialization of static data member 'const GUIIconAllParts mac::GUIIcon::iconParts' of incomplete type
error: could not convert '{{checkCircle, {2, {{1, 0, 0, none}, {30, 0, 0, none}}}}}' from '<brace-enclosed initializer list>' to 'const GUIIconAllParts {aka const std::map<mac::GUIIconType, mac::GUIIconParts>}'
Where am I going wrong?