Created
July 4, 2017 16:04
-
-
Save skyrpex/7fcc421104910de1dfd76d4b8b60590d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
boost::optional<int> f1(int a); | |
boost::optional<int> f2(int b, int c); | |
boost::optional<int> f3(int d); | |
boost::optional<int> f4(int e); | |
boost::optional<int> result = chain( | |
[] { return f1(3); }, | |
[] { return f1(4); } | |
).then( | |
[] (int b, int c) { return f2(b, c); } | |
).then( | |
[] (int d) { return f3(d); } | |
).then( | |
[] (int e) { return f3(e); } | |
).run(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment