Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <boost/function.hpp>
- #include <boost/bind.hpp>
- #include <vector>
- #include <iostream>
- void FOne(int k){
- std::cout<<k<<std::endl;
- }
- int main(){
- std::vector<boost::function0<void> > tasks;
- tasks.push_back(boost::bind(&FOne,5));
- tasks.push_back(boost::bind(&FOne,'c'));
- tasks.push_back(boost::bind(&FOne,3));
- tasks.push_back(boost::bind(&FOne,6));
- for(auto & i:tasks){
- i();
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement