[Development] final value classes: some background information and plans

Jedrzej Nowacki jedrzej.nowacki at nokia.com
Wed Mar 7 13:03:47 CET 2012


On Wednesday 7. March 2012 12.37.51 ext Marc Mutz wrote:
> On Wednesday March 7 2012, andre.poenitz at nokia.com wrote:
> > Marc Mutz wote:
> > > I've uploaded a patch series that makes most of the value classes in
> > > QtCore final in the C++11 sense (ie. under a C++11 compiler, these can
> > > no longer be inherited from).
> > 
> > I disagree with the idea of making Qt core classes non-inheritable.
> > 
> > While inheritance from "value" classes is rarely needed, it _is_ useful
> > at times. Most notably, private inheritance is even "pretty safe".
> > 
> > There is no need to artificially deprive us of useful tools.
> 
> Name one instance where (non-public, since public isn't safe) inheritance
> is useful and not just laziness on the part of the inheriter :)
> 
> Thanks,
> Marc

What are you trying to solve? Using raw pointers may be unsafe but it doesn't 
mean that the functionality should be removed from C++. I agree with Andre 
blocking inheritance is really radical move, that doesn't buy us much apart of 
SC problems.

Cheers,
  Jędrek
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20120307/94a6bc66/attachment.html>


More information about the Development mailing list