Y
Hacker News
new
|
ask
|
show
|
jobs
by
TuxSH
338 days ago
You use constinit. But this means constexpr constructor (easy with 2-phase init, not too much of a problem for singleton objects), and trivial destruction
1 comments
kazinator
338 days ago
Does that guarantee that the static object is constructed before the first execution of the block?
link
TuxSH
338 days ago
Yes, it will be constructed at compile time. Not everything can be constinit.
link