help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is it not possible to use unsigned short and bool data typessimultan


From: Paul Pluzhnikov
Subject: Re: Is it not possible to use unsigned short and bool data typessimultaneously for function overload?
Date: Wed, 12 Dec 2007 22:50:32 -0800
User-agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.4 (Jumbo Shrimp, linux)

"Deepak Goyal" <dgoyal@parasoft.com> writes:

> :o="urn:schemas-microsoft-com:office:office" 
> xmlns:w="urn:schemas-microsoft-com:office:word"
> xmlns="http://www.w3.org/TR/REC-html40";>

Please don't do that. Posting HTML to Usenet is a really bad
idea(TM), unless you want to be ignored. So is posting the same
message twice in a row :(

> Is it not possible to use unsigned short and bool data types simultaneously?

No: it is perfectly possible to use them simultaneously.

> Is it a bug in GCC?

No: it's a bug in your program.

> class display
> {
> public :
>   int my_method(unsigned short int);
>   int my_method(bool);
...
>   s.my_method(4);

Which of the two overloaded methods did you expect the call above
to go to? And why? Hint: the compiler is telling you that it can't
choose, because both choices are equally bad.

Cheers,
-- 
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]