Enough typedef
s.
Create a new type when using
std::variant
by Zhihao Yuan
From the article:
class rock {}; class paper {}; class scissors {}; using hand = std::variant<rock, paper, scissors>;Ignoring the fact that this
hand
type comes with heavily overloaded constructors and you can only add free functions, a troublesome issue is that the type-namestd::variant<rock, paper, scissors>
will appear everywhere in debuggers and linkers in place ofhand
.
Add a Comment