我有一个提升递归变体,如下所示。当我使用断言比较两个递归变体对象时,它工作正常,但使用 EXPECT_EQ,它会产生编译错误。
typedef boost::make_recursive_variant<bool, boost::uint8_t, boost::uint32_t,
boost::int32_t, double, std::string, boost::uuids::uuid>::type rvariant_type;
variant_type b1 = true;
rvariant_type b2 = true;
assert(b1 == b2); //work fine
EXPECT_EQ(b1,b2); //gives compiler error.
EXPECT_EQ(boost::get<bool>(b1), boost::get<bool>(b2)); //works fine
boost/v1.46.1/include/boost/variant/detail/variant_io.hpp:64: error: no match for 'operator<<' in '((const boost::detail::variant::printer > >*)this )->boost::detail::variant::printer >>::out_ <<操作数'</p>