There were quite a few comments on my last post. I’d like to clear up a few (imo) misconceptions there.

What I wrote in the last post is not enabled by the default in Qt. So, you should not have any problems during development while using auto with Qt5 (btw, it has almost the same behaviour in Qt4).

From my POV, it is not a bug, but rather an expected behaviour. I only tested the code after writing the blog post - already knowing and expecting the result I got. If you explicitly enable the optimization, it is expected that you know what you are doing.

The lazy evaluation here is a new feature that auto provides. And, as with any other new feature, you just need to learn how to use it.

That, combined by the desire to be as efficient as possible which makes QStringBuilder to use const references instead of copying the QString object, makes it behave like this.

This can not break the existing code for two reasons - you don’t use auto in it, and you probably do not define the QT_USE_FAST_OPERATOR_PLUS macro before including QString.