Array member-initializers in GCC
The other day I ran across some code like this:
template<class T>
struct Holder {
T t_;
explicit Holder() : t_() {}
Holder(const Holder& rhs) : t_(rhs.t_) {}
~~~~
};
This was in an old codebase, which until recently had still been using
GCC’s -Weffc++
to enforce C++98 idioms such as the explicitly non-defaulted
copy constructor depicted above.
If you’re still using
-Weffc++
, please, stop using it!