Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- template<class F1, class F2>
- F2 operator|(F1 f1, F2 f2) { return [=](unsigned long long x) { return f2(f1(x)); }; };
- auto func1 = [](unsigned long long x) { return 2.F*x; };
- auto func2 = [](float x) { return (int)x; };
- int main(int argc, char *argv[])
- {
- auto comp = func1|func2;
- }
Advertisement
Add Comment
Please, Sign In to add comment