3 ms·
When does std::variant allocate?
by hn_go_brrrrr 5y ago
When does std::variant allocate?
- PaulDavisThe1st 5y agoboost::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.
- gumby 5y agoIs std::variant forbidden from doing this per standard or is it simply one (or several) implementations that made this choice?