, QVariant , boost::optional. :
bool QVariant::isNull() const
bool QVariant::isValid() const
Type QVariant::type()
static QVariant QVariant::fromValue(const T & value)
T QVariant::value()
So, you can wrap any type, check if the option is null or valid, or even get the type that will be used with the if or switch statement.
dtech source
share