This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/40804] STL: operator>= for pair "hides" general operator>= from std::rel_ops
- From: "mariofutire at googlemail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 Jul 2009 17:29:27 -0000
- Subject: [Bug libstdc++/40804] STL: operator>= for pair "hides" general operator>= from std::rel_ops
- References: <bug-40804-17963@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from mariofutire at googlemail dot com 2009-07-19 17:29 -------
I have removed one of the "using" and still get the same problem:
#include <utility>
#include <functional>
using namespace std::rel_ops;
struct A
{
bool operator<(const A &) const;
};
void foo1()
{
bool ok = A() >= A(); // just to check rel_ops is actually included
}
void foo2()
{
std::greater_equal<A> ge;
bool bad = ge(A(), A());
}
An alternative way is to replace the "using namespace std::rel_ops;" with
using std::rel_ops::operator>=;
but this means I have to repeat it for every operator I need.
Is there an other way to make all operators defined in rel_ops available?
--
mariofutire at googlemail dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |UNCONFIRMED
Resolution|INVALID |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40804