Say I have two literals of type T. I would like to check if they were equivalent, but type βTβ has only the βlessβ operator. How can I test this in C ++?
You can emulate the equality operator with a pair of βlessβ comparisons and negatives:
if (!(t1 < t2) && !(t2 < t1)) { printf ("t1 and t2 are equivalent"); }
Source: https://habr.com/ru/post/1204453/More articles:Bad address is thrown - c ++R: cannot read text files in Unicode even when specifying encoding - windowsLaravel - Querybuilder with joining and concat - phpMake navigation item active if route doesn't match - javascriptHow to get Inspect Element code in Selenium WebDriver - seleniumNew relic for monitoring workers at Amazon Kinesis - amazon-web-servicesAngularJS is the best way to handle state on manually entered URLs - javascriptDifferent HTML output text - javascriptUITableView in Today Extension not accepting row taps - iosnumpy.sum () gives `TypeError: sum () received an unexpected keyword argument 'dtype`` - numpyAll Articles