fork download
  1. #include <iostream>
  2. #include <functional>
  3.  
  4. int
  5. main()
  6. {
  7. std::function<bool(int)> f(
  8. [] (int n) -> bool {
  9. return !(n % 3 || n % 5);
  10. }
  11. );
  12.  
  13. if (f(15)) std::cout << "stfu!" << std::endl;
  14. if (!f(8)) std::cout << "stfu anyway!" << std::endl;
  15. return 0;
  16. }
Success #stdin #stdout 0s 3412KB
stdin
Standard input is empty
stdout
stfu!
stfu anyway!