ambiguous operator>>(char&)

Z

Zorro

In header file istream there is an overload for every built-in type,
except char. Is there a reason for this?
GCC 3.3.4. is the compiler.
Thanks.
 
M

Mehturt

Zorro said:
In header file istream there is an overload for every built-in type,
except char. Is there a reason for this?
GCC 3.3.4. is the compiler.
Thanks.

For char and others there's a global operator>>, not member of
istream..
See [27.6.1.2.3] character extraction templates.
 
Z

Zorro

Zorro said:
In header file istream there is an overload for every built-in type,
except char. Is there a reason for this?
GCC 3.3.4. is the compiler.
Thanks.

For char and others there's a global operator>>, not member of
istream..
See [27.6.1.2.3] character extraction templates.

Thanks Mehturt. I read that. However, I could not see a technical
reason. So the question is this. Is it a decision, or there is a sound
technical reason for specializing the operator for bool (which is a
char) but not for types of char and "unsigned char"? For instance, if I
do it myself in the header file, will something go wrong at run time? I
am not saying that I will actually change the system header file.

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,042
Latest member
icassiem

Latest Threads

Top