[Development] QUIP 6: removing top-level const from return types

Olivier Goffart olivier at woboq.com
Mon May 22 16:14:59 CEST 2017


Am Montag, 22. Mai 2017, 12:04:10 CEST schrieb Marc Mutz:
> Hi,
> 
> Removing top-level const from return types is a QUIP-6 Cat-A SiC, but was
> missing from the examples.
> 
> https://codereview.qt-project.org/195285 proposes to add it to the QUIP.
> 
> Precedence: E.g. https://codereview.qt-project.org/93161

I think it's fine to break SiC in this case.

Maybe we can have a  QT_RETURNED_CONST_TYPE macro that would be defined to 
"const" iff Q_COMPILER_MANGLES_RETURN_TYPE is defined, or nothing otherwise.
That way one would just write:

  QT_RETURNED_CONST_TYPE QPixmap pixmap() const;

and we would avoid any #ifdef 

-- 
Olivier

Woboq - Qt services and support - https://woboq.com - https://code.woboq.org



More information about the Development mailing list