[Development] C++20 structural types (was: C++20 @ Qt)

Allan Sandfeld Jensen kde at carewolf.com
Fri Nov 4 18:38:30 CET 2022

On Freitag, 4. November 2022 16:49:30 CET Thiago Macieira wrote:
> I've just hit this: should we make some of our very simple types even
> simpler so they're structural types[1] and thus can be passed as template
> parameters?
> For example, QFlags. I've just tried it and I get:
> error: ‘QFlags<Qt::AlignmentFlag>’ is not a valid type for a template
> non-type parameter because it is not structural
> note: ‘QFlags<Qt::AlignmentFlag>::i’ is not public
> [1] https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0732r2.pdf

Can we even do that, and still preserve ABI and API?

Best regards,

More information about the Development mailing list