This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/40186] floating point comparision works wrong ( !(a < b) && (b > a) is true )
- From: "ich at az2000 dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 18 May 2009 13:16:10 -0000
- Subject: [Bug c++/40186] floating point comparision works wrong ( !(a < b) && (b > a) is true )
- References: <bug-40186-17447@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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