Can we explicitly typecast the value which is to be stored in boost varaint??
Example:
typedef int abc;
typedef int asd;
typedef boost::variant<abc, char, asd, float> link_try1;
int main()
{
link_try1 qw;
qw = static_cast<asd>(1234);
printf("value of which is:%d", qw.which());
return 0;
}
Here I want the which() function to retrun 3 but it always retruns 0. Is there a way of directly changing the value in which_ (private variable in class variant) or explicitly specifying the datatype to be used??
Regards Ankith