Why is ts_less written this way?

   inline bool ts_less::operator()(const unsigned int& l,
               const unsigned int& r) const
   {
     return (l - r > (unsigned int)(1<<31));
   }

A naive programmer would think that (l < r) would work just as well.
Also, it seems like there are cases where the function would return
the incorrect value, as when l==0x80000002 and r==0x00000001.


-- 
Mark Sidell
Partner
Forte, Inc.
919-942-7068
fax 919-969-2844
www.forteinc.com
_______________________________________________
Sems mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/sems

Reply via email to