why can't use ternary operator with different types when boost variable can hold multiple types?
I have something like below, but unable to compile it. I don’t get it why I can’t have different type when my variable can hold different types? My code: #include <boost/variant.hpp> #include <iostream> typedef boost::variant<int, float, double, std::string> MultiType; int main() { int a = 1; std::string b = "b"; bool c = true; MultiType… Read More why can't use ternary operator with different types when boost variable can hold multiple types?