This gives me a compiler error:
public static delegate void SomeCoolDelegate();
Why?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Ok so I think what happens is this:
Declaring a delegate is really asking the compiler to create a new special class for you. The job of this class is to act as a function pointer (or multiple function pointers if needed).
The compiler will oblige by creating a new class as you direct with all the things you need to get your job done with the delegate. It will go ahead and create this class, but all the things you are getting are instance level methods and properties, etc.
So declaring a delegate as static is nonsensical (As JaredPar and others pointed out). You are saying ‘give me a static class wherein all the guts are not static (and thus unreachable), etc. etc.” It doesn’t make sense.