Does using epsilon in comparison of floating-point break strict-weak-ordering?

  c++, epsilon, strict-weak-ordering

Does following class breaks strict-weak-ordering (in comparison to regular std::less)

struct LessWithEpsilon
{
    static constexpr double epsilon = some_value;
    bool operator() (double lhs, double rhs) const
    {
        return lhs + epsilon < rhs;
    }
};

LessWithEpsilon lessEps{};

Source: Windows Questions C++

LEAVE A COMMENT