C++: std::optional and std::variant will copy values by default
std::optional and std::variant are attractive alternatives to raw pointers and unions, but they come with a caveat: when you create an optional/variant from a “real” value, a copy will be […]