22 May
2010
22 May
'10
3:54 p.m.
Hi I'm facing a inconsistent behavior with Variant when bool is defined. The below code will return i as 0 typedef boost::variant <int> VariantType; VariantType variant; int i = boost::get <int> (variant)); // default to 0 If I set a bool in the variant typedef boost::variant <bool, int> VariantType; VariantType variant; int i = boost::get <int> (variant)); // this throws fail get Is it intended behavior? Robin