On Friday, February 15, 2013 23:49:53 monarch_dodra wrote: > On Friday, 15 February 2013 at 22:06:55 UTC, Steven Schveighoffer > > wrote: > > With opcmp: > > > > int opCmp(int a, int b) > > { > > > > return a - b; > > > > } > > Genius! > > Now I feel bad for every time I've done integral opCmp with > double ternary operators :(
Except that you have to worry about overflow if you use subtraction, so it's actually a bad idea in the general case. - Jonathan M Davis