Closed mwthinker closed 2 years ago
I checked the initialization jungle on cppreference.com and since all the math classes: a) are all trivially constructable and b) don't have user-defined default constructors this should be fine.
Meaning: it should just be covered by Explanation, Effects 2), post C++11, without the extra note about compilers applying. https://en.cppreference.com/w/cpp/language/value_initialization
Opened a PR on my fork since it said PRs are generally discourage here on the main repo? https://github.com/franklange/box2d/pull/1
Let me know if this is wanted and I'll point it to master here :)
Thanks for the report. I changed the default constructors in a1225ee95b1203b463b6d30469606a7a70899f67
but I think the expected behavior is Zero initialization for the second version.
By doing this you get no performance hit by default but still give the user a possibility to zero initialization. And no surprise when it is not zero initialized,