News for hackers. Stuff that matters.
Re:Const vs. constexpr vs. consteval vs. constinit in C++20 by brianjacobs on Monday November 28, 2022 @10:22PM (#33783306)
In summary:

    constexpr variables are constant and usable in constant expressions

    constinit variables are not constant and cannot be used in constant expressions

    constexpr can be applied on local automatic variables; this is not possible with constinit, which can only work on static or thread_local objects

    you can have a constexpr function, but it’s not possible to have a constinit function declaration

There are no comments on this comment yet.