Advertisement
konalisp

lambda_example.cxx

Oct 12th, 2014
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.76 KB | None | 0 0
  1. #include <iostream>
  2. #include <functional>
  3. #include <vector>
  4. #include <ctime>
  5.  
  6. using namespace std;
  7.  
  8. template<typename Type>
  9. int pyro ( Type );
  10. int etho ();
  11. int randy ( int, int );
  12.  
  13. int randy ( int max, int min = 0 ) {
  14.     srand(time(NULL));
  15.     return rand() % (max + min);
  16. }
  17.  
  18. template<typename Type>
  19. int pyro ( Type dildo ) {
  20.     vector<string> s = {"siiick", "last round last round", "not the twilight!", "game theory!"};
  21.     dildo(s);
  22.     return 0;
  23. }
  24.  
  25. int etho () {
  26.     pyro<function<void(vector<string>)>>(
  27.         [](vector<string> ar) {
  28.             cout << "\"" << ar[randy(ar.size())] << "\" " << "Pyropuncher said as Etho rammed the pink dildo up Pyro's anus";
  29.         }
  30.     );
  31.     return 0;
  32. }
  33.  
  34. int main () {
  35.     etho();
  36.     return 0;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement