Today a small rant… with a bit of an unexpected conclusion!
In the beginning someone decided to use
std::variant
. This has made a lot of people very angry and been widely regarded as a bad move.
So at work this week I had to look at code written with std::variant
… a lot can be said about std::variant
but this time it is about compile errors!
Someone had decided to use an std::variant<x, y, z>
, probably got a really bad error-message when they tried to extract a value out of it with the type w
, i.e. a type that is not part of the variant. Something like this, but simplified.