如何绑定到vector <> :: at?

Kit*_*sto 3 c++ functor

在Visual C++ 2013中,以下代码给出了一个"模糊调用"编译错误:

typedef vector<int> V;
V v;
auto b1 = bind(&V::at, &v);
Run Code Online (Sandbox Code Playgroud)

现在我四处搜索,发现我应该投射到我想要的签名.所以我这样做:

auto b2 = bind(static_cast<int(V::*)(V::size_type)>(&V::at), &v);
Run Code Online (Sandbox Code Playgroud)

现在,错误是:

'static_cast' : cannot convert from 'overloaded-function' to 'int (__thiscall std::vector<_Ty>::* )(unsigned int)'
Run Code Online (Sandbox Code Playgroud)

我该怎么做才能正确?

Kon*_*lph 5

返回类型V::atV::reference:

auto b = std::bind(static_cast<V::reference (V::*)(V::size_type)>(&V::at), v);
Run Code Online (Sandbox Code Playgroud)

不用说,这是令人厌恶的.