error C2280: try function references deleted

 

#include<unordered_map>


struct SceneData { unordered_map<CString, CString> mConversationWord; //unordered_map<wchar_t, INODE> mEntry; //unordered_map<CString, INODE> mConversationAni; //unordered_map<CString, INODE> mCheckAni; //unordered_map<CString, INODE> mDoor; };

  Beginning with the map, then I wanted to use the index to find the value directly, then replaced hash_map, did not think today that it has been abandoned Micro software, according to tips VS2019 will head into unordered_map, and the use of that type.

  c2280 error occurs unexpectedly.

 

Observe the output 

       

 

 

CString class for use std :: hash <_Kty> :: hash (const std :: hash <_Kty> &) when generating the key, reference is _Kty = ATL :: CString, but this configuration is considered to be deleted, and the compiler has been used std :: hash <_Kty> :: hash key is generated, reference is _Kty = ATL :: CString.

It seems the problem lies in the key, rather than the value. Error message will disappear after the key into simple type.

Use the Internet to see Union, the article reported the same error. The solution is to replace the simple type CString. There are no destructors in public rights and permissions of the reported error.

 

Guess you like

Origin www.cnblogs.com/ice-arrow/p/11724546.html