On Thursday 19 September 2024 07:33:10 GMT-7 Volker Hilsheimer via Development wrote: > My preference would be "static constexpr inline”, as static is the most > important piece of information (storage and calling convention in case of > member functions), constexpr is “good to know”, and inline is in practice > mostly an implementation detail.
That was my preference too, but without any formalism why. Just a gut feeling. But Arthur's argument that static and inline are both storage keywords, so it would be important to keep them together, whereas constexpr replaces a const for variable declarations. Since we don't do "static const inline bool", we ought not to put the constexpr either. For curiosity, there is one const inline: $ git -P sgrep 'const inline' \* '!*/3rdparty/*' qtmultimedia/src/multimedia/darwin/qcoreaudioutils_p.h: static const inline unsigned bufferMultiplier = 4; > It also has the advantage that it keeps code grep-friendly, i.e. I can > search for anything “static constexpr” (which for out-of-lined members is > the clear preference in existing code), and find everything, even if it’s > also inline. Yeah, but by the same token you could be searching for static inline, of which we have far more in our sources. -- Thiago Macieira - thiago.macieira (AT) intel.com Principal Engineer - Intel DCAI Platform & System Engineering
smime.p7s
Description: S/MIME cryptographic signature
-- Development mailing list Development@qt-project.org https://lists.qt-project.org/listinfo/development