From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8846 invoked by alias); 19 Oct 2002 10:58:17 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 8822 invoked by uid 61); 19 Oct 2002 10:58:16 -0000 Date: Sat, 19 Oct 2002 03:58:00 -0000 Message-ID: <20021019105816.8821.qmail@sources.redhat.com> To: gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, jbuck@synopsys.com, nobody@gcc.gnu.org, paolo@gcc.gnu.org From: paolo@gcc.gnu.org Reply-To: paolo@gcc.gnu.org, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, jbuck@synopsys.com, nobody@gcc.gnu.org, paolo@gcc.gnu.org, gcc-gnats@gcc.gnu.org Subject: Re: c++/8279: REGRESSION: failure to find a matching function in ostream_iterator expansion X-SW-Source: 2002-10/txt/msg00738.txt.bz2 List-Id: Synopsis: REGRESSION: failure to find a matching function in ostream_iterator expansion Responsible-Changed-From-To: unassigned->paolo Responsible-Changed-By: paolo Responsible-Changed-When: Sat Oct 19 03:58:15 2002 Responsible-Changed-Why: . State-Changed-From-To: open->feedback State-Changed-By: paolo State-Changed-When: Sat Oct 19 03:58:15 2002 State-Changed-Why: The testcase doesn't compile with 3.0.4/3.1.1/Icc6 either. I'm not a language lawyer but what about putting the operator<< inside namespace std:: ?? The following works for me (and all the compilers above): #include #include #include #include typedef std::pair Pairtype; namespace std { inline std::ostream& operator<<(std::ostream& o, const Pairtype& a) { o << a.first << ": " << a.second; return o; } } int main() { std::vector data; std::copy(data.begin(), data.end(), std::ostream_iterator(std::cout, "\n")); } http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8279