On Fri, 4 Nov 2005, Tim Jenness wrote:
>> I notice you have changed #define to enum in grp.h. What's the
>> rationale behind that?
>
> I don't really like the C preprocessor and I've been bitten by constants
> being interpreted as doubles rather than ints.
>
> I'm switching to enum to give the compiler as much help as possible.
> I changed all the _err.h files a while back.
David,
another often stated advantage of enums over defines is that you can
inspect the value when using a debugger (since enums are handled by the
compiler, not the preprocessor).
Peter.
|