
3 Dec
2009
3 Dec
'09
2:31 p.m.
I'm trying to get the program to compile if the variant takes on the guise of an int (because I've implemented void operator()(int &i) const, but not compile if I make the variant take the guise of a char e.g. boost::variant
var = 'a'; because I've not implemented the void operator()(char &c) const
boost::variant and boost::static_visitor involve *static* (i.e. compile-time) type checking, so it can't matter what actual type you feed into the variant in *runtime*.