diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2014-08-08 10:31:36 +0200 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@digia.com> | 2014-08-09 09:06:16 +0200 |
commit | e41b45f1aedf1b3fe0ca4b22226ccc23bc71ab7c (patch) | |
tree | d64d54c7f865b19028548e8e6dceef760b9ae6a9 /src/tools/uic/globaldefs.h | |
parent | 31f2b7e5911f730245cf347924d1c839fc2832a4 (diff) |
QPair: add constexpr liberally
On templates, adding constexpr makes a given instantiation constexpr
if it can be.
This turns qMakePair(0,0), say, into a compile-time constant.
The effects on existing code are small, but exist:
$ size lib/*{-baseline,-paircexp} | sort -nr
6516727 211192 2608 6730527 66b31f lib/libQt5Widgets.so.5.4.0-baseline
6516711 211192 2608 6730511 66b30f lib/libQt5Widgets.so.5.4.0-paircexp
5373720 44492 15976 5434188 52eb4c lib/libQt5Core.so.5.4.0-baseline
5373504 44492 15976 5433972 52ea74 lib/libQt5Core.so.5.4.0-paircexp
5107206 125072 6080 5238358 4fee56 lib/libQt5Gui.so.5.4.0-baseline
5107030 125072 6080 5238182 4feda6 lib/libQt5Gui.so.5.4.0-paircexp
1341290 30180 2600 1374070 14f776 lib/libQt5Network.so.5.4.0-baseline
1341210 30180 2600 1373990 14f726 lib/libQt5Network.so.5.4.0-paircexp
# no other libraries benefit
[ChangeLog][QtCore][QPair] Can now be used in C++11 constexpr contexts.
Change-Id: I3872e6aa33a7d02a168516f4dfa7119efcac8c40
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Diffstat (limited to 'src/tools/uic/globaldefs.h')
0 files changed, 0 insertions, 0 deletions