Looking at the sample program:
struct A
{
float c;
float d;
A(){};
};
struct B
{
int a;
int b;
};
struct C
{
A a;
B b;
};
void func(C c)
{
}
int main(int argc, char *argv[])
{
float c, d;
int a,b;
func(C{{c,d},a,b});
}
Why does the parameters for A (the floats) need braces since it has a constructor whilst the parameters for B does not?
I have the problem where if I define any sort of constructor I can no longer send in parameters one by one, like the example does with struct B in func().
Am I missing some sort of special construtor to make this possible? Note that the difference is that A does not utilize the default constructor, and that is why it no longer works.