[Development] API style guide: scoped enum or not?

Thiago Macieira thiago.macieira at intel.com
Fri May 5 07:48:44 CEST 2023


On Thursday, 4 May 2023 22:28:44 PDT Thiago Macieira wrote:
> But for those that use a very name, the API becomes cumbersome:
> 
>   Qt::Alignment al = Qt::AlignmentFlag::Left;
> 
> Can we do better? With C++20 using enum (GCC 11, Clang 13, so not in my
> proposal) we could easily.

Actually, we can leave that as an optional feature for GCC 10 and Clang 10, if 
we choose those as our minima. We wouldn't be able to use the used 
enumerations in our code until the feature became mandatory, but users whose 
compilers do support the feature could use it.

https://codereview.qt-project.org/c/qt/qtbase/+/476084

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Cloud Software Architect - Intel DCAI Cloud 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/20230504/74349207/attachment.bin>


More information about the Development mailing list