fork download
  1. #include <functional>
  2. #include <iostream>
  3.  
  4. typedef void (*VF)();
  5.  
  6. VF Test() {
  7. return nullptr;
  8. }
  9.  
  10. int main(int argc, char* argv[]) {
  11. std::function<void()> foo;
  12. std::cout << !!foo << std::endl;
  13.  
  14. foo = nullptr;
  15. std::cout << !!foo << std::endl;
  16.  
  17. foo = Test();
  18. std::cout << !!foo << std::endl;
  19.  
  20. return 0;
  21. }
Success #stdin #stdout 0s 3340KB
stdin
Standard input is empty
stdout
0
0
1