fork(1) download
  1. #include <functional>
  2. #include <iostream>
  3.  
  4. class Socket
  5. {
  6. public:
  7. template<typename T>
  8. void recv(const T& func) {}
  9. };
  10.  
  11. class Client
  12. {
  13. public:
  14. void handshake() {}
  15. };
  16.  
  17. int main()
  18. {
  19. Socket sock;
  20. Client client;
  21. sock.recv([&client](std::string data)
  22. {
  23. client.handshake();
  24. });
  25. }
  26.  
Success #stdin #stdout 0s 3336KB
stdin
Standard input is empty
stdout
Standard output is empty