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

Re: comparing function pointer with int does not produce error



> 	The following code does not produce an error when one is expected.
> void stat ();
> 
> static const int success = 0;
> 
> void monk ()
> {
>   if (stat == success);
> };

Thanks for your report. This is not a bug in the compiler: both the
function pointer and the integer convert to bool (4.12). So this is a
boolean comparison, and thus well-formed C++.

Regards,
Martin



Reply to: