[Development] (Bikeshed, pedantic) East constexpr vs West constexpr

Thiago Macieira thiago.macieira at intel.com
Fri Sep 20 23:34:34 CEST 2024


On Friday 20 September 2024 13:57:14 GMT-7 Marc Mutz via Development wrote:
> FTR, I'm voting -1 on "static constexpr inline" (without further
> qualification), because Q_CONSTINIT must come _first_ (it's an attribute
> in C++17, keyword only in C++20), and it makes no sense to require
> constexpr and constinit to be at different positions.

Arthur didn't conclude on constinit. If we take the doubt that it is not a 
const attribute but modifying the statement, it's fine for it to be all the way 
to the left.

BTW, I prefer "constexpr inline", but I think Arthur's reasoned argument makes 
sense to adopt, which would make it "inline constexpr", so that it's inline is 
always next to "static", if it is there. Plus, all constexpr are inline, so 
there's no such thing as an out-of-line constexpr (whether we have to write 
the keyword or not).

That said, the inline keyword can be omitted for functions, so moving it to 
the right where we usually won't try to grep makes some sense.

-- 
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/20240920/8a259834/attachment-0001.bin>


More information about the Development mailing list