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

Popular posts from this blog

Out of index C/C++ -

regex - PatternSyntaxException: while using String.ReplaceAll function in java? -

objective c - how Set autolayout for multiple dynamic buttons and labells in iOS? -