As far as I know, doesn’t make any difference for primitive types like floats whether the assignment or the curly braces are used. (For more complicated types I’ve encountered cases where a compiler didn’t want to accept using = to initialize the members.)
int magicFunction(int magicNumber);
int magicNumber{10};
Sort of - only the literals make it really obvious for me…and I’ve got the auto formatter set up so things look like this with a bit of spacing in there.
int magicFunction(int magicNumber);
int magicNumber{ 10 };
Still in your defence. I do think the equals states what’s going on more clearly than braces. But if the C++ tide is drifting towards braces I don’t know if want to stand in its way
How much is the decision c/e reasoning and/or how much is it taste?
I must admit I like a better as all initialisation is in one place whereas c/e can lead to the initialisations being cluttered in the class declaration.
It will also save you if you forget to initialise a member.
There is one key difference between using = and { } in that the latter will emit narrowing errors at compile time so is safer. You may be lucky enough to get a compiler warning for a conversion but having the build break is more secure in my opinion.