Advertisement
Guest User

Untitled

a guest
Mar 25th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. #include <iostream>
  2. #include <set>
  3. #include <vector>
  4. #include <deque>
  5. #include <algorithm>
  6. #include <cmath>
  7.  
  8. using namespace std;
  9.  
  10. double Pow(double x, double y) {
  11. return pow(x, y);
  12. }
  13.  
  14. int main() {
  15. set<int> myset = {3, 1, 25, 7, 12};
  16. deque<int> d;
  17. auto f = function<double (double, double)>(Pow);
  18. transform(myset.begin(), myset.end(),
  19. back_inserter(d),
  20. bind(f, placeholders::_1, 2));
  21. for (auto it : d) {
  22. cout << it << " ";
  23. }
  24. for (auto it : myset) {
  25. cout << it << " ";
  26. }
  27. cout << endl;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement