最佳答案
nameof
运算符在编译时求值。
The nameof expression is a constant. In all cases, nameof(...) is evaluated at compile-time to produce a string. Its argument is not evaluated at runtime, and is considered unreachable code (however it does not emit an "unreachable code" warning).
因此,这些运算符不能被重载。
关于c# - 是否可以在 C# 中重载 nameof 运算符?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47811561/