On Monday 02 February 2015 14:29:21 Matthew Woehlke wrote: > > * Q_DECL_EQ_DEFAULT - really discouraged > > > > > > I can't think of any case where you could use this and let the code still > > compile in C++98, so don't use it > > I'd actually like to see this used where possible and sensible, as the > compiler may be able to optimize better (or it can make POD types that > otherwise wouldn't be POD). > > You can use it like: > > class QFoo { QFoo(const QFoo&) Q_DECL_EQ_DEFAULT; } > #if // '= default' not supported > QFoo::QFoo(const QFoo& other) { ... } > #endif > > ...that is, provide a definition conditional on Q_DECL_EQ_DEFAULT > expanding to empty. (This will also make it easy to rip out the old code > if/when C++11 becomes a requirement for Qt.)
This class is better written as: class QFoo { // implicit copy constructor is fine }; -- Thiago Macieira - thiago.macieira (AT) intel.com Software Architect - Intel Open Source Technology Center _______________________________________________ Development mailing list Development@qt-project.org http://lists.qt-project.org/mailman/listinfo/development