Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2014
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.42 KB | None | 0 0
  1. #include <boost/function.hpp>
  2. #include <boost/bind.hpp>
  3. #include <vector>
  4. #include <iostream>
  5. void FOne(int k){
  6.     std::cout<<k<<std::endl;
  7. }
  8. int main(){
  9.     std::vector<boost::function0<void> > tasks;
  10.     tasks.push_back(boost::bind(&FOne,5));
  11.     tasks.push_back(boost::bind(&FOne,'c'));
  12.     tasks.push_back(boost::bind(&FOne,3));
  13.     tasks.push_back(boost::bind(&FOne,6));
  14.     for(auto & i:tasks){
  15.             i();
  16.     }
  17.     return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement