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 libstdc++/40804] STL: operator>= for pair "hides" general operator>= from std::rel_ops



------- 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


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