That’s not required the initialization is valid, and that shouldn’t make any difference, but using initializer declaration might not be supported for this or might behave differently
No idea what is going on sorry, but it is definitely not what other people are suggesting.
@normalized Initiliaser list with union will populate the first listed member (the struct in this case) unless you do fancy stuff with very modern lang features (i.e. your compiler probably doesn’t support it). You do not need an outer brace pair for it, and indeed that then won’t match anything and will be a compile error.
Looks like both {0.0, 1.0, 0.0} and {{0.0, 1.0, 0.0}} will work as expected with C++14 onward if the class hasn’t got any constructors defined. If there is a 3 argument constructor, {0.0, 1.0, 0.0} will always call that constructor.
{0.0, 1.0, 0.0} won’t compile with C++11 if there is no matching constructor but if there is - it will use that constructor.
In any case, {0.0, 1.0, 0.0} should work with Godot’s Vector3 class unless the OP is using some obscure compiler setup that somehow ignores the initializer list and uses the default constructor which nullifies the components.
Interesting. I had (after I made the post) tested in isolation and discovered I was wrong and both worked, which seemed strange as it didn’t work with godot::Vector3, but given I was looking at an apparent bug someone else was reporting and I could not repro, I moved on to something more productive (or something else, at the least ;)).
Adding a 3 param ctor to that test breaks the {{...}} init with the same error I got in Godot. Thanks for sharing your more thorough testing!