6 Jun
2015
6 Jun
'15
7:31 a.m.
On 5 Jun 2015, at 13:21, Uthpal Urubail
wrote: Experts, I am using boost::tuple as key in std::map. I would like to write my own comparison method (considering tolerance in comparison)
Map comparators must impose a strict weak ordering on the keys. Typically trying to use a tolerance means that transitivity is violated (ie a <= b and b <= c does not imply a <= c). If you must use floating point types as keys you need to be careful.