同名函数

Functions with the same name

我正在尝试使用一个名为 bind() 的函数,此函数包含在 WinSock2.h 中。但是,当我 "go to definition" 函数 VS 将我带到另一个文件时。

因此,我尝试使用的 bind() 函数位于:

c:\Program Files (x86)\Windows Kits.1\Include\um\WinSock2.h

但是 VS 它从以下函数获取函数:

c:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\functional

如何"force" VS 使用我想要的功能?

在 C++ 头文件中 <functional> 包含 std::bind 函数。

所以如果你想使用你自己的绑定函数,你不必写using namespace std

因为 VS 将您的绑定函数理解为 std::bind of namespace std

C++ reference of bind function来了。