Hi,

> If this was a common pattern, I wonder if it would be worth having the
> compiler inline Enum.IsDefined to avoid the boxing?   Worth considering.

I think that Enum.IsDefined should not be inlined (by the compiler) because 
it is a run-time reflection API that has to reflect changes made to the 
metadata after (C#) compilation. (Usually by using a newer version of the 
referenced assembly. But metadata can even be modified after C# compilation 
when the enum and the calling code is in the same module.)

Enum range checking should be done by using <= and >= along with enum 
members. (When the values are in multiple ranges a switch statement should 
do the job.)

Kornél 

_______________________________________________
Mono-winforms-list maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-winforms-list

Reply via email to