| 46 | }; |
| 47 | |
| 48 | int main(int, char**) { |
| 49 | functional_executor e; |
| 50 | auto executor = &e; |
| 51 | |
| 52 | // clang-format off |
| 53 | |
| 54 | (http_request("github.com") && http_request("atom.io")) |
| 55 | .then([] (std::string /*github*/, std::string /*atom*/) { |
| 56 | // ... |
| 57 | return mysql_query("select * from `users`"); |
| 58 | }) |
| 59 | .then([] (ResultSet /*result*/) { |
| 60 | // ... |
| 61 | }, executor->post()); |
| 62 | |
| 63 | // clang-format on |
| 64 | |
| 65 | http_request("github.com") && http_request("atom.io"); |
| 66 | |
| 67 | http_request("github.com") || http_request("atom.io"); |
| 68 | |
| 69 | http_request("github.com") >> http_request("atom.io"); |
| 70 | |
| 71 | // clang-format off |
| 72 | |
| 73 | read_file("entries.csv") |
| 74 | .then([] (Buffer /*buffer*/) { |
| 75 | // ... |
| 76 | return std::make_tuple("hey", true, 0); |
| 77 | }) |
| 78 | .then([] (std::string /*msg*/) { |
| 79 | // ... |
| 80 | }); |
| 81 | |
| 82 | // clang-format on |
| 83 | |
| 84 | return 0; |
| 85 | } |
nothing calls this directly
no test coverage detected