suppose that I have such a variant definition:
typedef boost::variant <
v1,
v2,
v3,
...
vn
> v;
and I need to write a visitor class with visitor functions for each v1 to vn like this:
class myvisitor : public boost::static_visitor<bool> {
bool operator()(v1) {}
bool operator()(v2) {}
...
bool operator()(vn) {}
}
So if all such functions are the same except the one for v1, then I would like to only define
bool operator()(v1) {}
while leave all others to some default form to avoid writing lots of useless and duplicated code.
So if this is possible? or can the boost developer do this on his next version?