From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10706 invoked by alias); 10 May 2003 17:46:01 -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 10687 invoked by uid 71); 10 May 2003 17:46:01 -0000 Date: Sat, 10 May 2003 17:46:00 -0000 Message-ID: <20030510174600.10675.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Dave Brondsema Subject: Re: c++/8567: std::endl is of unknown type when overloading operator<< (repeat in case attachment didnt work) Reply-To: Dave Brondsema X-SW-Source: 2003-05/txt/msg00974.txt.bz2 List-Id: The following reply was made to PR c++/8567; it has been noted by GNATS. From: Dave Brondsema To: gcc-gnats@gcc.gnu.org, jstanek@vrac.iastate.edu, gcc-bugs@gcc.gnu.org, nobody@gcc.gnu.org, gcc-prs@gcc.gnu.org, jstanek@iastate.edu Cc: Subject: Re: c++/8567: std::endl is of unknown type when overloading operator<< (repeat in case attachment didnt work) Date: Sat, 10 May 2003 10:36:08 -0700 (PDT) http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8567 The following 2 samples are based on the solutions given, but still fail to compile. I'm using g++ (GCC) 3.2.2 on i686 #include class BlackHole{}; template BlackHole& operator<<(BlackHole& bh, const T& dummy); template BlackHole& operator<<(BlackHole& bh, T& (*dummy)(T&)); int main() { BlackHole bh; bh << std::endl; } ======= test.cpp: In function `int main()': test.cpp:11: no match for `BlackHole& << ' operator ======= ======= #include class BlackHole{}; template BlackHole& operator<<(BlackHole& bh, const T& dummy); (*dummy)(T&)); BlackHole& operator<<(BlackHole& bh, int& (*dummy)(int&)); int main() { BlackHole bh; bh << std::endl; } ======= test.cpp: In function `int main()': test.cpp:11: no match for `BlackHole& << ' operator test.cpp:7: candidates are: BlackHole& operator<<(BlackHole&, int&(*)(int&)) ===== Dave Brondsema dave@brondsema.net http://www.brondsema.net - personal http://www.splike.com - programming __________________________________ Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. http://search.yahoo.com