Article View: gnu.g++.help
Article #773Bogus error in type conversion (gcc-2.7.0) ??
From: Stefan Neis
Date: Mon, 25 Sep 1995 11:26
Date: Mon, 25 Sep 1995 11:26
23 lines
1355 bytes
1355 bytes
Hi there, Using g++-2.7.0 (which normally just works great...) I got a strange error message today: module_div2.C: In function `int main()': module_div2.C:26: call of overloaded method `operator <<(order)' is ambiguous alg_number.h:418: candidates are: operator <<(ostream &, const module &) alg_number.h:174: operator <<(ostream &, order &) I defined classes "order" and "module" and there is a cast - operator which makes modules out of orders. Do I just not sufficiently understand the details of C++? In my opinion the compiler should always be able to recognize, that it should use operator <<(ostream &, order &) to output an order, even if there is a cast from order to module, the "cast" from order to order & should be prefered, shouldn't it? Cheers, Stefan P.S.: I know, I didn't supply any code, but to decide, whether this is an bogus error or not, the information should be sufficient...
Technical Details
Message-ID:
<9509251126.AA04531@voyager.cs.uni-sb.de>Path:
arc1-ca.pugleaf.net!cs.uni-sb.de!neisShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!cs.uni-sb.de!neis
From: neis@cs.uni-sb.de (Stefan Neis)
Newsgroups: gnu.g++.help,comp.lang.c++
Subject: Bogus error in type conversion (gcc-2.7.0) ??
Date: 25 Sep 1995 07:26:57 -0400
Organization: Universitaet des Saarlandes
D-66041 Saarbruecken, Germany
Sender: daemon@cis.ohio-state.edu
Distribution: world
Message-ID: <9509251126.AA04531@voyager.cs.uni-sb.de>