日韩无码专区无码一级三级片|91人人爱网站中日韩无码电影|厨房大战丰满熟妇|AV高清无码在线免费观看|另类AV日韩少妇熟女|中文日本大黄一级黄色片|色情在线视频免费|亚洲成人特黄a片|黄片wwwav色图欧美|欧亚乱色一区二区三区

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時(shí)間:8:30-17:00
你可能遇到了下面的問題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
C++屬性具體概念詳解

C++編程語言中的屬性是一個(gè)比較基礎(chǔ)的知識(shí)概念,我們初學(xué)者們在學(xué)習(xí)的過程中需要對這一基礎(chǔ)知識(shí)有一個(gè)深刻的認(rèn)識(shí),以方便將來的應(yīng)用。在這里就一起來了解一下C++屬性的相關(guān)概念。

“__declspec”是Microsoft c++中專用的關(guān)鍵字,它配合著一些屬性可以對標(biāo)準(zhǔn)C++進(jìn)行擴(kuò)充。這些C++屬性有:

align、allocate、deprecated、dllexport、dllimport、 naked、noinline、noreturn、nothrow、novtable、selectany、thread、property和uuid。

 
 
 
  1. template < class T1, class T2> class KeyValuePair  
  2. {  
  3. private:  
  4. //-- 參數(shù)  
  5. T1 *Key;  
  6. //------值  
  7. T2 *Value;  
  8. public  
  9. :  
  10. KeyValuePair()  
  11. {  
  12. Key=new T1;  
  13. Value=new T2;  
  14. }  
  15. ~KeyValuePair()  
  16. {  
  17. delete Key;  
  18. delete Value;  
  19. }  
  20. public :  
  21. T1 GetKey()  
  22. {  
  23. return this->Key;  
  24. }  
  25. T1 SetKey(T1 inputKey)  
  26. {  
  27. this->Key=inputKey;  
  28. }  
  29. private :  
  30. int m_old;  
  31. public:  
  32. //---------屬性----get--------set--------返回?cái)?shù)據(jù)---C++屬性名稱  
  33. _declspec(property(get=GetOld,put=SetOld))int Old;   
  34. int GetOld(void)  
  35. {  
  36. return m_old;  
  37. }  
  38. void SetOld(int value)  
  39. {  
  40. m_old=value;  
  41. }  
  42. };  
  43. int main(int argc, char* argv[])  
  44. {  
  45. KeyValuePair< int,int> c1;  
  46. c1.Old=123;  
  47. cout< < c1.Old;  

C++屬性相關(guān)概念就為大家介紹到這里。


網(wǎng)頁標(biāo)題:C++屬性具體概念詳解
當(dāng)前URL:http://www.5511xx.com/article/cdisjpo.html