Boost logo

Boost :

From: Bronek Kozicki (brok_at_[hidden])
Date: 2006-04-22 05:56:00

Alberto Ganesh Barbati wrote:
> template <typename T>
> struct compare_absolute_error : std::binary_function<T, T, bool>

> bool operator()(T x, T y) const { return abs(x - y) < eps; }
> 1) Is there interest for this?

I'm not math expert, but I certainly agree that such utility would be useful.
However, as some standard algorithms need equality comparison, while
containers need less-than comparison, it would be nice to provide at least
then both, and make names obvious enough.

> 2) What are the comparison algorithms to include?

good question. But if comparision algorithm is a template parameter (policy
class), we do not have to define them all in advance.


Boost list run by bdawes at, gregod at, cpdaniel at, john at