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

5

u/eric_niebler Jun 17 '15

A valid variant can never be empty. It is possible to have an invalid variant, but only by ignoring exceptions. Well-behaved code doesn't do that.