I currently have the following:
struct MsgHeader_t
{
int a;
float b;
};
which initializes a default const as
const MsgHeader_t default = { 0, 0.0f };
which was working fine. Now I have to extend it and it MUST inherit from another struct. So now I have.
struct MsgId_t
{
unsigned int id;
};
struct MsgHeader_t : public MsgId_t
{
int a;
float b;
};
But now when I try to initialize that default const (const MsgHeader_t aMessage = { 0, 0, 0.0f };
)
I get
error: braces around initializer for non-aggregate type 'const MsgHeader_t'