From: "Rafal 'Raf256' Maj" Newsgroups: comp.os.msdos.djgpp Subject: ambignous ? Date: 14 Jul 2002 20:31:35 GMT Organization: news.onet.pl Lines: 60 Sender: raf256 AT poczta DOT onet DOT pl@rafal.joint.eu.org Message-ID: NNTP-Posting-Host: rafal.joint.eu.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-2 Content-Transfer-Encoding: 8bit X-Trace: news.onet.pl 1026678695 26804 62.233.182.179 (14 Jul 2002 20:31:35 GMT) X-Complaints-To: abuse AT onet DOT pl NNTP-Posting-Date: 14 Jul 2002 20:31:35 GMT User-Agent: Xnews/5.03.24 X-Complains-To: admin AT raf256 DOT com To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Hi, I have a little problem -8<----------------------------------------------- #include #include class coWidth { public : int m; coWidth(int a) : m(a) { } }; ofstream& operator<<(ofstream &s, coWidth cmd) { return s; } int main() { ofstream s; s<<' '; return 0; } -8<----------------------------------------------- This source generates error : tmp.cpp(14) Error: choosing `std::basic_ostream& std::operator<<(std::basic_ostream&, char) [with _Traits = std::char_traits]' over `std::ofstream& operator<<(std::ofstream&, coWidth)' tmp.cpp(14) Error: because worst conversion for the former is better than worst conversion for the latter There were some errors I wanted to use class coWidth only manual s<