#include <iostream>
#include <Algorithm>
#include <string>
#include <vector>
using namespace std;
double pow(double x,double y)
{
return pow(x,y);
}
int main()
{
//内置functors less less_equal greater greater_equal not_equal_to logical_and
//minus plus divide modulus negate
int x = multiplies<int>()(1, 2);
bool b = not_equal_to<int>() (x,1);
//Binding
vector<int>vec = { 1,2,3,4,5,6,7,8,9 };
vector<int>vec2;
//multiplies的第一个参数来源于vec 第二个参数是10
transform(vec.begin(),vec.end(),back_inserter(vec2), bind(multiplies<int>(), placeholders::_1,10));
auto f = function<double (double, double)>(pow);
vector<double>vec3;
transform(vec.begin(), vec.end(), back_inserter(vec3), bind(f, placeholder::_1, 2));
system("pause");
return 0;
}