[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [pooma-dev] enums vs. static data members
From: |
Mark Mitchell |
Subject: |
Re: [pooma-dev] enums vs. static data members |
Date: |
Sat, 24 Mar 2001 18:12:25 -0800 |
>>>>> "Julian" == Julian Cummings <address@hidden> writes:
Julian> the expression "(wildcard==1)" being passed as a template
Julian> argument to these functions. The aCC alternately
Julian> complains that either "wildcard" is not defined in the
Julian> current context or that there is no appropriate operator==
Julian> defined to evaluate the expression.
I'm not sure what would cause the former problem, but the second
complaint is most likely bogus. Conversion from an enumeration type
to an integer type is an integral promotion, and, as such, a "usual
arithmetic conversion". However, if there were weird template
`operator==' functions in scope, that could prompt this problem,
perhaps.
Julian> I hate using these enums because different compilers seem
Julian> to treat them differently. An alternative would be to
Julian> define a static bool "wildcard" in these classes, set it
Yes, that is definitely cleaner. Old compilers will not accept this,
but I don't think we care anymore.
Julian> static variables. You can't just stick this in the class
Julian> definition.
Well, that's pedantically true. Most compilers will let you slide by
without defining the static data member, but you should do it anyhow.
--
Mark Mitchell address@hidden
CodeSourcery, LLC http://www.codesourcery.com