|
|
|
|
|
by forrestthewoods
241 days ago
|
|
Literally every single time I have ever used std::variant or worked with code that used std::variant I wish it was done without it. Every time. And that’s not an exaggeration or me being hyperbolic. Named constants aren’t significantly better. Multiple types in a variant breaks many things with god awful error messages. And that is a fact. I am hyperbolic on HN. That’s true. My sentiment is sometimes but rarely wrong! std::variant is bad and no one should use it ever, imho. It sucks and is horribly ergonomic and doing certain things makes it even less ergonomic. Friends don’t let friends use std::variant. Now ask me my opinion on global variables and how many times I have had to debug mysterious crashes that you’ll never guess the root cause! |
|