c++ - Test for equivalence with only less than operator? -
Say I have two types of type 'T'. I want to test whether they are equivalent, but type 't 'Only' less' operator has been implemented in how can I test it in C ++?
You can simulate equality operator with two "less than comparisons" and a rejection :
if (! T1 and LT; T2) & amp; (T2 and LT; T1)) (printf ("t1 and t2 equivalent");} < / Code>
Comments
Post a Comment