[Development] (Bikeshed, pedantic) East constexpr vs West constexpr
Thiago Macieira
thiago.macieira at intel.com
Wed Sep 18 17:18:16 CEST 2024
Which one are we?
That is,
constexpr inline foobar
or
inline constexpr foobar
I prefer the former. And then there's the question of the ordering when static
is present too.
Data:
we prefer to write "static inline" at 9:1
$ git sgrep 'static inline' \* '!*/3rdparty/*' | wc -l
4199
$ git sgrep 'inline static' \* '!*/3rdparty/*' | wc -l
464
and we prefer "static constexpr" at 18:1:
$ git sgrep 'static constexpr' \* '!*/3rdparty/*' | wc -l
3344
$ git sgrep 'constexpr static' \* '!*/3rdparty/*' | wc -l
181
We have a 4:1 preference to constexpr inline:
$ git sgrep 'constexpr inline' \* '!*/3rdparty/*' | wc -l
1273
$ git sgrep 'inline constexpr' \* '!*/3rdparty/*' | wc -l
341
And there are a couple of places using all three:
$ git sgrep 'static constexpr inline' \* '!*/3rdparty/*' | wc -l
57
$ git sgrep 'static inline constexpr' \* '!*/3rdparty/*' | wc -l
53
$ git sgrep 'inline static constexpr' \* '!*/3rdparty/*' | wc -l
16
$ git sgrep 'inline constexpr static' \* '!*/3rdparty/*' | wc -l
0
$ git sgrep 'constexpr inline static' \* '!*/3rdparty/*' | wc -l
0
$ git sgrep 'constexpr static inline' \* '!*/3rdparty/*' | wc -l
13
--
Thiago Macieira - thiago.macieira (AT) intel.com
Principal Engineer - Intel DCAI Platform & System Engineering
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5152 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/development/attachments/20240918/2a9af7cf/attachment.bin>
More information about the Development
mailing list