Re:Folly: An open-source C++ library developed and used at F...
by PaulDavisThe1st on Friday January 07, 2022 @03:16PM
(#29844165)
interesting case in point. i just learned today that std::variant and boost::variant differ in their:
1. exception-safety guarantees
2. real-time safety
2 is caused by 1, because to be exception safe requires a heap allocation, and that's not RT-safe.Who would want to work in a language where you could not make these choices?
Re:Folly: An open-source C++ library developed and used at F...
by jcelerier on Saturday January 08, 2022 @02:28AM
(#29849483)
Boost even has variant2 which comes with another set of design tradeoffs
Re:Folly: An open-source C++ library developed and used at F...
by hn_go_brrrrr on Saturday January 08, 2022 @01:17AM
(#29849099)
When does std::variant allocate?
Re:Folly: An open-source C++ library developed and used at F...
by PaulDavisThe1st on Saturday January 08, 2022 @01:23AM
(#29849134)
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.
If I was using java or python I'd definitely not use the standard things most of the time either because it's more than likely that there's a more efficient way in some other library, and because my main paycheck comes from "can you make this as fast as technically possible given this average consumer hardware"-problems