SHARE
TWEET

Untitled




Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- void main(){
- // create the client
- auto client = std::make_unique<sf::TcpSocket>();
- // setup listener
- .
- .
- .
- listener.accept(*client);
- createthread(...., thread_func,...., std::move<client));
- // this local client variable is no longer valid now !!!!
- // do more stuff
- .
- .
- .
- }
- void thread_func(std::unique_ptr<sf::TcpClient> client){
- // use the client variable here
- }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.