r/cpp • wx | soci | swig • Jun 17 '15

Standardizing Variant: Difficult Decisions

https://www.justsoftwaresolutions.co.uk/cplusplus/standardizing-variant.html
31 Upvotes

56 comments sorted by

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 void is 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 noexcept and do it like the article suggests.