std for each 的奇怪現象

2021-06-10 08:42:06 字數 369 閱讀 8317

直接晾**

template

void test(std::pairpair)

int _tmain(int argc, _tchar* argv)

這個可以編譯通過,但是改一下

template

void test(std::pair&  pair)  //加乙個引用

int _tmain(int argc, _tchar* argv)

就編譯不通過了

再改一下

struct test 

};int _tmain(int argc, _tchar* argv)

這下可以編譯通過了,為什麼函式不能傳引用,而結構體重載的operator()可以傳引用?

richedit控制項奇怪現象

在對話方塊中新增了乙個richedit控制項,對話方塊就不顯示了 鬱悶,我試圖彈出乙個對話方塊,步驟如下 1.建立了乙個對話方塊資源的模板 2.雙擊模板建立對應的類 3.包含標頭檔案 4,彈出對話方塊,如下 caddtypedlg dlg dlg.domodal 但是,卻無法彈出對話方塊?其他的對話...

GetCursorPos()函式的奇怪現象

在對話方塊上拖乙個list控制項。風格定義如下 m listresult.setextendedstyle lvs ex checkboxes lvs ex fullrowselect lvs ex gridlines 在list表中插入多行資料,使得垂直滾動條可用。相應list的雙擊訊息 void...

MapMaker 的乙個奇怪現象

concurrentmaptestmap new mapmaker concurrencylevel 32 weakkeys weakvalues expiration 3,timeunit.seconds makecomputingmap new function 而一旦return null 著...