3 ms·Why not just use constexpr in the second case?by cherryteastain 1y agoWhy not just use constexpr in the second case?kazinator 1y agoWhat if the object is to be mutable?TuxSH 1y agoYou use constinit. But this means constexpr constructor (easy with 2-phase init, not too much of a problem for singleton objects), and trivial destructionkazinator 1y agoDoes that guarantee that the static object is constructed before the first execution of the block?TuxSH 1y agoYes, it will be constructed at compile time. Not everything can be constinit.