[Development] SIC adding ref-qualified overloads

Olivier Goffart olivier at woboq.com
Wed Jul 30 20:14:58 CEST 2014

On Wednesday 30 July 2014 10:26:34 Thiago Macieira wrote:
> Re: https://codereview.qt-project.org/90981
> https://codereview.qt-project.org/90982
> https://codereview.qt-project.org/90986
> https://codereview.qt-project.org/75296 (5.3)
> https://codereview.qt-project.org/74636 (5.3)
> https://codereview.qt-project.org/67728 (5.3)
> The commits above replace certain const member functions in QString,
> QByteArray and QImage with a pair of ref-qualified member functions (a const
> & and an &&) so that in-place conversion can be performed if possible.
> Those changes are technically source-incompatible: if you take the address
> of one of those functions, your code will stop compiling. This was found in
> Creator:
> https://codereview.qt-project.org/90988
> The change is transparent for regular calls of those functions.

It is not much different than adding an overload, and we do that quite often.

> Given the benefits awarded by those changes and the fringe uses of taking
> PMFs to those functions, I'm going to ask that we keep accepting this type
> of changes, with a proper entry in the changelog.

On the other hand, QString is a foundation class, and use of the PMF to those 
functions is not so uncommon. Just search the pattern on Google:
(but yes, that's still not so much)

> [There's no need to reply if you agree with this proposal]

oops :-)

(I agree with the proposal, I am just providing some data points)


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

More information about the Development mailing list