I want to have boost::variant
with empty state. So I define a boost::variant
with boost::blank
as the first alternative. But then I want to pass this as function parameter:
void f(Variant v);
...
void g()
{
f(boost::blank{});
}
It does not look nice due to braces. Seem to be better if it accepted boost::none
:
void g()
{
f(boost::none);
}
But I don't think I have seen boost::variant<boost::none_t, ...>
anywhere. boost::none_t
is a satellite of boost::optional
. Is it fine to use with boost::variant
?