标签: c#
IMO,此运营商不能超载,但我在网上找不到任何内容,所以
我需要确认运营商' ::'可以在C#中重载?
答案 0 :(得分:5)
没有
您只能重载some of C#'s operators。 ::,namespace alias qualifier不在其中。
::
答案 1 :(得分:2)
不,它不能超载。
看看Overloadable Operators (C# Programming Guide)
Overloadable Operators (C# Programming Guide)
答案 2 :(得分:1)
C#中的:: operator适用于名称空间,因此没有什么可以在类级别覆盖,因此不能重载。