#include<iostream>
#include<functional>
using namespace std;
using namespace std::placeholders;
int main()
{
auto func=bind(plus<>(), 10, 20);
int n=func(4);
auto func1=bind(multiplies<int>(),bind(plus<int>(),_1,10),2);
int n1 = func1(7);
auto func2 = bind(multiplies<int>(), bind(multiplies<int>(), _1, _1), _1);
int n2 = func2(7);
auto func3 = bind(divides<int>(), _2,_1);
int n3 = func3(7,49);
n3 = func3(7,49,2);
auto func4 = bind(divides<int>(), _3, _1);
n3 = func4(7,6, 49);
return 0;
}
#include<iostream>
#include<functional>
#include<vector>
#include<new>
using namespace std;
using namespace placeholders;
int foo(int a, int b, int c, int d, int e)
{
int res = a + 2 * b + 3 * c + 4 * d + 5 * e;
return res;
}
template<typename T,int n>
void fdfasd(T a)
{
cout << n << endl;
}
template<bool b>
constexpr int kkk;
template<>
int kkk<true> = 20;
template<>
constexpr int kkk<false> = 30;
int main()
{
int resflase = kkk<false>;
int restrue = kkk<true>;
char szdfalse[kkk<false>];
fdfasd<int,4>(3);
auto sp = unique_ptr<int[]>(new int[3]{9,8,7});
int *pa=sp.release();
delete[]pa;
auto ps = new auto(3);
auto g = bind(foo, 1, 2, _2, 4, _1);
int res = g(3, 5);
int z = 3;
auto pf = [z]()mutable {
int a = 3;
z++;
if (a > 0)
return 0;
return -1;
};
cout << pf() << endl;
return 0;
}