This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/40186] floating point comparision works wrong ( !(a < b) && (b > a) is true )



------- Comment #2 from ich at az2000 dot de  2009-05-18 13:16 -------
This is a real problem, because in my real application, I tried to use a very
similar order in a std::set<tmp*,CustomOrder>, defined like this:

struct CustomOrder {
        bool operator()(const Tmp* a, const Tmp* b) const {
                return a->get() < b->get();
        }
};

STLport gives this assertion when inserting Tmp pointers with equal values
(returned by get() function):

/usr/include/stlport/stl/debug/_tree.h(63): STL error : Invalid strict weak
ordering predicate, if pred(a, b) then we should have !pred(b, a)
/usr/include/stlport/stl/debug/_tree.h(63): STL assertion failure:    
!_M_non_dbg_cmp(__rhs, __lhs) 


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40186


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]