I have the problem when I add
using namespace std;
that the compiler says that there is no confection to long for bind.
simple example:
#include <winsock2.h>
#include <mutex>
#include <iostream>
using namespace std;
int main()
{
WSADATA wsa;
long rc = WSAStartup(MAKEWORD(2, 0), &wsa);
SOCKADDR_IN addr;
SOCKET acceptSocket = socket(AF_INET, SOCK_STREAM, 0);
memset(&addr, 0, sizeof(SOCKADDR_IN));
addr.sin_family = AF_INET;
addr.sin_port = htons(1234);
addr.sin_addr.s_addr = ADDR_ANY;
rc = bind(acceptSocket, (SOCKADDR*)&addr, sizeof(SOCKADDR_IN));
return 0;
}
it would be a simple one now
using namespace std;
to renounce... but I have further:
std::vector<Structs*>::iterator it = m_ClientList.begin();
for (; it != m_ClientList.end(); ++it)
and when i remove the using namespace std I get the following error message:
C2672 "std :: invoke": no matching overloaded function found
C2893 Function template "unknown-type std :: invoke (_Callable &&, _ Types && ...) noexcept (<expr>)" could not be specialized
I don't know where to put another std :: in
std::vector<Structs*>::iterator it = m_ClientList.begin();
not before iterator...