[Development] [docs/c++] How do we deal with the special member functions (copy/move ctor/assignment operator, dtor, default ctor)

Marc Mutz marc.mutz at kdab.com
Fri Aug 1 23:16:40 CEST 2014


Hi,

As part of the move to C++11, we have dropped some user-defined special member 
functions from the API if they weren't doing anything else than the ones the 
compiler implicitly creates for us. This has the advantage that a C++11 
compiler will create move ctors without the need for #ifdef'ing them It does 
that if the class does not have a user-defined copy ctor, among other criteria.

That leaves the question how to deal with the documentation for these implicit 
members.

One way would be to add them in an #ifdef Q_QDOC block and document them.

A better way would be to make qdoc generate some abstract docs for them 
automatically.

However, unless someone takes it upon himself to implement the C++11 rules 
governing the deletedness or existence of these special member functions, a 
middle way could be a \deletedcopyctor / \defaultcopyctor in the \class 
documentation, maybe?

Thanks,
Marc

-- 
Qt Developer Days 2014 - October 6 - 8 at BCC, Berlin

Marc Mutz <marc.mutz at kdab.com> | Senior Software Engineer
KDAB (Deutschland) GmbH & Co.KG, a KDAB Group Company
www.kdab.com || Germany +49-30-521325470 || Sweden (HQ) +46-563-540090
KDAB - Qt Experts - Platform-Independent Software Solutions



More information about the Development mailing list