示例#1
0
bool operator==(either<Left, Right> const& lhs, either<Left, Right> const& rhs)
{
    if (lhs.is_left() == rhs.is_left())
    {
        if (lhs.is_left()) return lhs.left() == rhs.left();
        else return lhs.right() == rhs.right();
    }
    return false;
}
示例#2
0
 void EXPECT_LEFT_IS(const Expected &expected, either<Left, Right> &value) {
   EXPECT_IS_LEFT(value);
   EXPECT_EQ(expected, value.left());
   EXPECT_EQ(expected, value.left_opt().get());
   EXPECT_EQ(boost::none, value.right_opt());
   const either<Left, Right> &const_value = value;
   EXPECT_EQ(expected, const_value.left());
   EXPECT_EQ(expected, const_value.left_opt().get());
   EXPECT_EQ(boost::none, const_value.right_opt());
 }
示例#3
0
bool operator==(either<Left, Right> const& lhs, Left const& rhs)
{
    return lhs.is_left() && lhs.left() == rhs;
}