1 post tagged #constructors.
#constructors
With the empty constructor spelled = default in the class, T() and T{} zero a class and the class stays trivial. Spelled {} or defined outside the class, neither zeroes it and the class is not trivial. On GCC 16.2 and Clang 22.1 the difference shows in constant expressions, in traits and in what a read of an unset member gives.
// We use Google Analytics to understand which posts get traction and how the wro.cpp community grows. Anonymised, no ads, and you can decline -- the site works either way.