On Thursday, March 28, 2002, at 06:12 AM, David Megginson wrote:

> Jonathan Polley writes:
>
>> .\src\Input/input.hxx(321) : error C2248: 'MAX_MOUSE_BUTTONS' : cannot
>> access private enumerator declared in class 'FGInput'
>>          .\src\Input/input.hxx(250) : see declaration of 
>> 'MAX_MOUSE_BUTTONS'
>>
>> Changing the enumeration to a series of #defines solved that problem.
>
> [expletive deleted] The only reason I use enums instead of constants
> is to work around earlier MSVC bug reports, since MSVC barfed on
> constants.

This brings about the philosophical question, Is is possible to work 
around ALL MSVC bugs?

>   Using defines for constants or macros in a header file is
> out of the question -- on a project this size, they create serious
> management problems (i.e. no other class can use a variable, constant,
> or method with the same name).

I also don't like the name space problems that #defines cause, especially 
when it forces the programmer to mangle the names in order to avoid 
conflicts.  My guess as to what is happening here is that MSVC is deciding 
to make the enum dynamic rather than static.  Since it is dynamic, the 
compiler does not believe that it can know the value of MAX_MOUSE_BUTTONS 
at compile time and will make a function call to determine its value 
instead.  I am use to seeing this behavior with brain dead Ada compilers.

I suppose I could check myself, but do you know of any other instances of 
this construct in the code?  Since this is the only complaint I got from 
the compiler, it would be interesting to see where MSVC liked the 
construct to see if I could find out why.

> Thanks for looking into these problems.
>
>
> All the best,
>
>
> David
>
> --
> David Megginson
> [EMAIL PROTECTED]
>
>
> _______________________________________________
> Flightgear-devel mailing list
> [EMAIL PROTECTED]
> http://mail.flightgear.org/mailman/listinfo/flightgear-devel
>

Jonathan Polley


_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel

Reply via email to