[Interest] Future of constexpr in Qt?

Volker Hilsheimer volker.hilsheimer at qt.io
Thu Nov 21 17:42:28 CET 2024



> On 21 Nov 2024, at 10:55, Schimkowitsch Robert <Robert.Schimkowitsch at andritz.com> wrote:
> 
> I’d like to use constexpr more in the future in order to catch UB in compile-time tests of functions.
> Qt has a little constexpr sprinkled here and there, but not a lot. Does anyone know if there are plans to expand Qt in this direction?
>  Kind regards
>  Robert

Hi Robert,

It’s generally not an item on the roadmap to make constexpr everything that can be. But when we touch code with expressions that could be constexpr, then we might make that change as a drive-by, if the code would otherwise benefit from it.

If there’s any part of Qt where you’d see significant value from making things constexpr, then you’re welcome to push things for review.

Cheers,
Volker



More information about the Interest mailing list