Advertisement
Guest User

Untitled

a guest
Apr 26th, 2015
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. Examples of storing, passing and calling std::function objects using lambdas and std::bind.
  2.  
  3. The first example demonstrates a basic case and the second covers functions with parameters.
  4.  
  5. ## Usage
  6.  
  7. The following command compiles, executes and removes the example.
  8.  
  9. ## firstclass.cpp
  10.  
  11. ```sh
  12. c++ -o 1-firstclass 1-firstclass.cpp -std=c++11 \
  13. && ./1-firstclass \
  14. && rm 1-firstclass
  15. ```
  16.  
  17. ## firstclass-with-params.cpp
  18.  
  19. ```sh
  20. c++ -o 2-firstclass-with-params 2-firstclass-with-params.cpp -std=c++11 \
  21. && ./2-firstclass-with-params \
  22. && rm 2-firstclass-with-params
  23. ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement