fork(1) download
  1. #include <boost/bind.hpp>
  2. #include <vector>
  3. #include <iostream>
  4.  
  5. using namespace std;
  6.  
  7. void f2(vector<int> &h)
  8. {
  9. h.clear();
  10. h.push_back(0);
  11. }
  12.  
  13. void f1(vector<int> &h)
  14. {
  15. boost::bind(f2, boost::ref(h));
  16. }
  17.  
  18. int main()
  19. {
  20. vector<int> h;
  21. f1(h);
  22.  
  23. cout << h.size() << "\n";
  24. }
Success #stdin #stdout 0.02s 2724KB
stdin
Standard input is empty
stdout
0