Why must overloaded operators be declared public?
问题 I wanted to overload an operator in a class , and have it private so that it could only be used from within the class. However, when I tried to compile I got the error message "User-defined operator ... must be declared static and public: Why do they have to be public? 回答1: To answer half part of your question you may see the blog post by Eric Lippert. Why are overloaded operators always static in C#? Rather, the question we should be asking ourselves when faced with a potential language