Std :: bind and winsock.h bind confusion

I am working on a very large project, and in one file we suddenly got a compile-time error when the compiler seems to think that our winsock.h call bind()is actually a call std::bind(). There seems to be a piece of code somewhere in the include file using namespace std. We could try to find where these using namespace stdare used and delete them, but maybe there is a better way to do this?

+5
source share
2 answers

You can change your calls to use ::bind()to specify a global namespace.

+15
source

, . http://gcc.gnu.org/ml/libstdc++/2011-03/msg00143.html, std::bind , :

, socket bind() ​​:
int bind(int, const sockaddr*, socklen_t);
const , Variadic template std:: bind - . , socklen_t.

GCC, GCC std::bind , std::bind , "", is_integral is_enum. .

using namespace std; , , bind(), , std (, std::size_t), std::bind . - , : ::bind.

+7

All Articles