> Programming Languages > C++
Various Topics Home | Disclaimer | Report Adult Posts

Various Topics on C++



C++ - "'operator >>' is ambiguous" in Programming Languages


Old 06-20-2004   #1
.... ..
 
Default 'operator >>' is ambiguous

Can someone tell how to fix my visual c++ so it can discard this error
message.
I get this error message
error C2593: 'operator >>' is ambiguous
But I do not when I am on my mandrake linux platform. Why is this, a bug in
visual c++ ?

John J


 
Old 06-20-2004   #2
..v.. ..rm..
 
Default Re: 'operator >>' is ambiguous

On Sat, 19 Jun 2004 19:41:33 -0400 in comp.lang.c++, "John M"
<jj1100@hotmail.com> wrote,
>Can someone tell how to fix my visual c++ so it can discard this error
>message.
>I get this error message
> error C2593: 'operator >>' is ambiguous
>But I do not when I am on my mandrake linux platform. Why is this, a bug in
>visual c++ ?


Possibly a bug in VC++. Possibly a bug in g++.
How the heck could anybody guess when your code is secret?

 
Old 06-20-2004   #3
.... ..rris..
 
Default Re: 'operator >>' is ambiguous


"John M" <jj1100@hotmail.com> wrote in message
news:Na4Bc.320$s01.3850@news20.bellglobal.com...
> Can someone tell how to fix my visual c++ so it can discard this error
> message.
> I get this error message
> error C2593: 'operator >>' is ambiguous
> But I do not when I am on my mandrake linux platform. Why is this, a bug

in
> visual c++ ?
>
> John J
>


Post the code!!

My guess is that you are mixing correct headers (like <string>) with
incorrect headers (like <iostream.h>). In other words your code is at fault
not g++, or VC++. No C++ headers (except those that C++ gets from C) have a
..h

#include <iostream.h> // wrong
#include <iostream> // right

#include <fstream.h> // wrong
#include <fstream> // right

#include <string.h> // OK, C string handling
#include <string> // OK, C++ string handling

Gosh my psychic powers are good today.

john


 
Old 06-20-2004   #4
.... ..m.. ....
 
Default Re: 'operator >>' is ambiguous

"John M" typed:

> Can someone tell how to fix my visual c++ so it can discard this
> error message.
> I get this error message
> error C2593: 'operator >>' is ambiguous
> But I do not when I am on my mandrake linux platform. Why is this, a
> bug in visual c++ ?



I think it's a bug in VC++/6.0, though I may be wrong. I overloaded
the insertion operator for my own cl***, Questions, once. I placed a
number of such objects in a "list" container, declared an iterator,
moved it to point to the object that I wanted it to, dereferenced it,
and called

cout << *iter;

g++ didn't complain. VC++/6.0 flagged it as ambiguous.

--
Ayaz Ahmed Khan

"I don't trust him. We're friends". -- Bertolt Brecht

 

Thread Tools
Display Modes





Powered by vBulletin®
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0