
16 Mar
2005
16 Mar
'05
7:32 p.m.
Daniel James wrote:
template <class X, class Y> bool container_equal(X const& x, Y const& y);
bool MyType::operator==(MyType const& x) { return container_equal(use_a ? a : b, x.use_a ? x.a : x.b); }
The types of a and b also matters, the static casts here are a little
Oops, implicit casts, not static casts
worrying. But the point is, if the types are right, then Peter's proposal is ideal in this situation.