2016-06-24 54 views
-1
What I do not understand is the : 「UINT&」. What does it mean in the context of the template 

     static CMap<CString, LPCSTR, UINT, UINT&> cXMLfields::fields_by_name; 


     static CMap<CString, LPCSTR, UINT, UINT&> cXMLfields::oopf_fields_by_name; 
     static CString friendly_name[XML_FIELDNUM]; 
     static CString fields_by_id[XML_FIELDNUM]; 
     static CString oopf_fields_by_id[OOPF_XML_FIELDNUM]; 
     static void Build_map(); 
     static void MoveItem(CListBox& src, CListBox& dst, int index); 


CMap<CString,LPCTSTR, struct_sample,struct_sample> myMap; 
struct_sample aTest; 
aTest.a = 1; 
aTest.b = 2; 
aTest.c = 3; 
myMap.SetAt("test",aTest); 
    struct_sample aLookupTest; 
    BOOL bExists = myMap.Lookup("test",aLookupTest); //Retrieves the 
          //struct_sample corresponding to "test". 

我理解的理論,但我的關鍵是一個字符串例如「RFIDTAG1」。而我的值是一個無符號整數。例如.UNIT是特定關鍵字的值...例如{Age:27}其中Age是關鍵字,而27是Value.I當值是一個整數時掙扎,我可以理解該值是否是一個結構。所以你可以使用{Age:27}作爲例子,並使用結構向我展示如下代碼:MFC類CMAP

+0

這個問題沒有任何意義。可怕的格式不起作用。你已經找到[edit]鏈接了;請嘗試諮詢[格式幫助](http://stackoverflow.com/editing-help)。 –

回答

0

&表示通過引用

看到這個link

也在這裏對MSDN

ARG_VALUE

用於VALUE參數

數據類型;通常是參考到VALUE。

+0

我理解這個理論,但我的關鍵是一個字符串,例如「RFIDTAG1」 而我的值是一個無符號整數。示例:UNIT是特定鍵的值...例如{Age:27}其中Age是鍵,27是值 當鬥爭的價值是一個整數,我可以理解,如果值是一個結構。 –