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