Boost variant visitor with an extra parameter
问题 I have code that resembles below. typedef uint32_t IntType; typedef IntType IntValue; typedef boost::variant<IntValue, std::string> MsgValue; MsgValue v; Instead of saying this, IntValue value = boost::apply_visitor(d_string_int_visitor(), v); I would like to pass an extra parameter like this: But operator() gives a compile error. //This gives an error since the overload below doesn't work. IntValue value = boost::apply_visitor(d_string_int_visitor(), v, anotherStr); class d_string_int