SHARE
TWEET

Untitled

a guest Dec 3rd, 2019 87 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void main(){
  2.     // create the client
  3.     auto client = std::make_unique<sf::TcpSocket>();
  4.  
  5.     // setup listener
  6.     .
  7.     .
  8.     .
  9.     listener.accept(*client);
  10.     createthread(...., thread_func,...., std::move<client));
  11.     // this local client variable is no longer valid now !!!!
  12.  
  13.  
  14.     // do more stuff
  15.     .
  16.     .
  17.     .
  18.  
  19.    
  20.  
  21. }
  22.  
  23. void thread_func(std::unique_ptr<sf::TcpClient> client){
  24.     // use the client variable here
  25. }
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. OK, I Understand
 
Top