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 = [](float y)
- {
- return [=](unsigned long long x) { return y*x; };
- };
- auto func2 = [](float x) { return (int)x; };
- int main(int argc, char *argv[])
- {
- auto comp = func1(1.F)|func2;
- }
Advertisement
Add Comment
Please, Sign In to add comment