在Visual C++ 2013下面的代碼給了我一個「曖昧電話」編譯錯誤:如何綁定到vector <> :: at?
typedef vector<int> V;
V v;
auto b1 = bind(&V::at, &v);
現在我已經搜索了一圈,發現我應該鑄造我要簽名。所以我這樣做:現在
auto b2 = bind(static_cast<int(V::*)(V::size_type)>(&V::at), &v);
,錯誤的是:
'static_cast' : cannot convert from 'overloaded-function' to 'int (__thiscall std::vector<_Ty>::*)(unsigned int)'
我該怎麼辦呢正確?
是的,但它的邏輯。我只是沒有看到它。 –