#223 closed defect (fixed)

Cannot Convert Function Pointer to Bool

Reported by: ajbeach Owned by:
Priority: major Component: prelude
Version: 1.0 Keywords:
Cc:

Description

Actually there is a way which is:

bool variable = functionPointer != (ReturnType (*)(ParameterType))0;

I guess a more accurate name would be "None of the initially obvious methods of converting a function pointer to a Boolean work and the one way that does is excessively complex" but that is wordy.

The "initially obvious" solutions started with simple assignment, which works in C, but when that failed I tried != with 0 and 0p and those did not work either.

I believe this is more likely to be from missing functions in the prelude.

Change History (1)

comment:1 Changed 13 months ago by pabuhr

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.