fork download
  1. #include <iostream>
  2. #include <string>
  3.  
  4. void print(void (*printer)(const std::string&))
  5. {
  6. printer("Message");
  7. }
  8.  
  9. int main()
  10. {
  11. print([](const std::string& msg)
  12. {
  13. std::cout << msg << std::endl;
  14. });
  15. return 0;
  16. }
Success #stdin #stdout 0s 3428KB
stdin
Standard input is empty
stdout
Message