The function I'm trying to push into a thread:
void Send(sf::UdpSocket& newSocket, unsigned short& newPort, sf::IpAddress& newTargetIP, sf::Packet& newPackage)
{
string input;
cin >> input;
newPackage << input;
if(newSocket.send(newPackage, newTargetIP, newPort) != sf::Socket::Done)
cout << "Failed to send message." << endl;
else
cout << "You: " << input;
}
The thread construction:
sf::Thread Send(std::bind(&Send, socket, port, target, packet));
Error it gives:
'sf::NonCopyable::NonCopyable' : cannot access private member declared in class 'sf::NonCopyable'
This diagnostic occurred in the compiler generated function 'sf::Socket::Socket(const sf::Socket &)'
I know you can't copy sockets so I passed it though a reference, right? Sorry if it's an obvious answer.