Boost variant apply_visitor compilation error
问题 This simple example code for boost::variant and boost::apply_visitor: #include <boost/variant/recursive_variant.hpp> struct ExprFalse; struct ExprTrue; struct ExprMaybe; typedef boost::variant< ExprFalse, ExprTrue, ExprMaybe > Expression; struct ExprFalse { }; struct ExprTrue { }; struct ExprMaybe { }; struct Printer : public boost::static_visitor<> { public: Printer(std::ostream& os) : m_os(os) { } void operator()(ExprFalse const& expr) const { m_os << "False"; } void operator()(ExprTrue