This is the mail archive of the gcc-prs@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]

Re: libstdc++/4051 is not a bug


The following reply was made to PR libstdc++/4051; it has been noted by GNATS.

From: Philip Martin <philip_martin@ntlworld.com>
To: gcc-gnats@gcc.gnu.org, ola@cs.duke.edu, gcc-bugs@gcc.gnu.org
Cc:  
Subject: Re: libstdc++/4051 is not a bug
Date: 30 Aug 2001 21:31:07 +0100

 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=4051&database=gcc
 
 You have implemented the output operator for std::pair<int,int> in the
 global namespace, but you are attempting to use it via std::copy in
 the std namespace. Only the std namespace will be searched for an
 output operator. The complier correctly reports no match.
 
 Argument-dependent name lookup (3.4.2 [basic.lookup.koenig]) for a
 template id applies to the search for the output operator, allowing
 the output operator to be defined in the same namespace as the
 template or the template arguments. Thus when one of the std::pair is
 of class type, the namespace of the class will also be searched and so
 you have no problem.
 
 Philip
 


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