[Bug libstdc++/40804] STL: operator>= for pair "hides" general operator>= from std::rel_ops

rguenth at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Sun Jul 19 17:35:00 GMT 2009



------- Comment #4 from rguenth at gcc dot gnu dot org  2009-07-19 17:35 -------
Use it in struct A:

struct A
{
  using std::rel_ops;
  bool operator<(const A &) const;
};

ADL (also known as Koenig lookup) will then find it for arguments of type A.

it's really not a good idea to globally import pieces of the standard namespace
(using std; is an execption because it's just used so widely).


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


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



More information about the Gcc-bugs mailing list