Advertisement
Guest User

Untitled

a guest
Oct 24th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. #include <functional>
  2. #include <iostream>
  3.  
  4. using namespace std;
  5. using namespace std::placeholders;
  6.  
  7. void show(const string& a, const string& b, const string& c) {
  8. cout << a << "; " << b << "; " << c << endl;
  9. }
  10.  
  11. int main() {
  12. auto x = bind(show, _1, _2, _3);
  13. auto y = bind(show, _3, _1, _2);
  14. auto z = bind(show, "hi", _2, _1);
  15.  
  16. x("one", "two", "three");
  17. y("one", "two", "three");
  18. z("one", "two");
  19.  
  20. return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement