This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/8990: most algorithms in <algorithm> should require being qualified by std:: but aren't
- From: bangerth at dealii dot org
- To: dean at foster dot net, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org
- Date: 18 Dec 2002 16:30:07 -0000
- Subject: Re: c++/8990: most algorithms in <algorithm> should require being qualified by std:: but aren't
- Reply-to: bangerth at dealii dot org, dean at foster dot net, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, gcc-gnats at gcc dot gnu dot org
Synopsis: most algorithms in <algorithm> should require being qualified by std:: but aren't
State-Changed-From-To: open->closed
State-Changed-By: bangerth
State-Changed-When: Wed Dec 18 08:30:07 2002
State-Changed-Why:
What you are missing is that Koenig lookup makes sure that
the compiler looks up the function name also in the namespace
of the arguments given to the function. Since they are
iterators in your case, their data type is declared in
std::, so the compiler looks into std:: for the name of
the function and, lo and behold, finds what you want.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8990