Enough typedefs.
Create a new type when using
std::variantby Zhihao Yuan
From the article:
class rock {}; class paper {}; class scissors {}; using hand = std::variant<rock, paper, scissors>;Ignoring the fact that this
handtype 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