digitalmars.D - static attribute on class declaration
- John C (9/9) Mar 12 2005 Purely by accident, I discovered that the compiler doesn't issue an erro...
- Walter (6/13) Mar 12 2005 Because of the way attributes are parsed, ones that make no sense are ju...
- Craig Black (2/6) Mar 14 2005 Cool.
Purely by accident, I discovered that the compiler doesn't issue an error when the static attribute is used in a class declaration, like so: public static class MyClass { } It doesn't appear to be documented, so does it have a purpose? I initially thought it might be a shorthand for final and abstract (classes that can neither be instantiated nor derived from), but no. Anyway, just curious. John.
Mar 12 2005
"John C" <johnch_atms hotmail.com> wrote in message news:d102ra$skm$1 digitaldaemon.com...Purely by accident, I discovered that the compiler doesn't issue an error when the static attribute is used in a class declaration, like so: public static class MyClass { } It doesn't appear to be documented, so does it have a purpose? I initially thought it might be a shorthand for final and abstract (classes that can neither be instantiated nor derived from), but no.Because of the way attributes are parsed, ones that make no sense are just ignored. This is for things like: static: // everything that follows is static
Mar 12 2005
Because of the way attributes are parsed, ones that make no sense are just ignored. This is for things like: static: // everything that follows is staticCool. -Craig
Mar 14 2005