r/cpp • u/_VZ_ wx | soci | swig • Jun 17 '15
Standardizing Variant: Difficult Decisions
https://www.justsoftwaresolutions.co.uk/cplusplus/standardizing-variant.html
31
Upvotes
r/cpp • u/_VZ_ wx | soci | swig • Jun 17 '15
View all comments
Show parent comment
2
u/suspiciously_calm Jun 17 '15
You could also make the presence of a default constructor conditional on whether
voidis one of the possible types. If it is, enable the default constructor and have it construct a void variant.Also, if void is a possible type, you could drop the requirement that the move constructors be
noexceptand do it like the article suggests.