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

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -