Y
Hacker News
new
|
ask
|
show
|
jobs
by
hn_go_brrrrr
1624 days ago
When does std::variant allocate?
1 comments
PaulDavisThe1st
1624 days ago
boost::variant will allocate to save state during construction of a new value type, in order to be able to roll back if the constructor throws an exception.
std::variant does not do this.
link
gumby
1622 days ago
Is std::variant forbidden from doing this per standard or is it simply one (or several) implementations that made this choice?
link
std::variant does not do this.