1
我在C++ CLI代碼:爲什麼C++ CLI不允許使用擴展方法?
[System::Runtime::CompilerServices::ExtensionAttribute]
public ref class MyExtensions abstract sealed {
public:
[System::Runtime::CompilerServices::ExtensionAttribute]
static System::String^ SetC() {
return gcnew System::String("{") + gcnew System::String("}") ;
}
}
但是下面一行拋出字符串沒有成員國家經貿委錯誤。
System::String("").SetC();
我也曾嘗試使用下面的代碼太:
gcnew System::String("")->SetC();
是什麼,錯過了什麼?
是的,工作正常。 – 2013-03-14 20:48:35
還有一個問題,我作爲一個新的問題發佈.. http://stackoverflow.com/questions/15419974/why-c-sharp-change-my-color-structure-to-valuetype – 2013-03-14 20:55:10