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; }
void EXPECT_IS_RIGHT(const either<Left,Right> &val) { EXPECT_FALSE(val.is_left()); EXPECT_TRUE(val.is_right()); }
bool operator==(either<Left, Right> const& lhs, Left const& rhs) { return lhs.is_left() && lhs.left() == rhs; }