Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <set>
- #include <vector>
- #include <deque>
- #include <algorithm>
- #include <cmath>
- using namespace std;
- double Pow(double x, double y) {
- return pow(x, y);
- }
- int main() {
- set<int> myset = {3, 1, 25, 7, 12};
- deque<int> d;
- auto f = function<double (double, double)>(Pow);
- transform(myset.begin(), myset.end(),
- back_inserter(d),
- bind(f, placeholders::_1, 2));
- for (auto it : d) {
- cout << it << " ";
- }
- for (auto it : myset) {
- cout << it << " ";
- }
- cout << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement