0
我試圖JSON格式的字典字符串轉換,見下圖:字典裏沒有合適的拷貝構造函數
using namespace System::Web::Script::Serialization;
...
String ^data = "{Name: 'sherlock', Problem: 'deserialization'}";
JavaScriptSerializer ^serializer = gcnew JavaScriptSerializer();
Dictionary<String^, Object^> obj = serializer->Deserialize<Dictionary<String^, Object^>>(data);
我得到一個錯誤,
class "System::Collections::Generic::Dictionary<System::String ^, System::Object ^>" has no suitable copy constructor
我來自c#的新的C++/cli。我想我明白一個拷貝構造函數是,但我不知道爲什麼人們會在這種情況下是必要的,或者如何解決這個錯誤..
感謝
謝謝,我仍然得到這些句柄的掛鉤。我認爲還需要另一個泛型T arg字典,這解決了這個問題。再次感謝! – Sherlock
@Sherlock你是對的:) – Inisheer