>>Ya, you're right - I was looking at the KnownColor which is an enum but the object color is a struct.
>>
>>Interesting...
>
>Victor,
>Yeah it is kind of interesting. Neil posted a section from the docs that explain that a constant can not be a class or a struct. The docs does not explain why a class or a struct can be used as a constant.
Constants must be evaluated at compile time. Functions must be evaluated at run time. Since a struct may well have functions (including a constructor), I don't see how it can be acceptable to the compiler as a constant.
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only