diff options
author | Determinant <ted.sybil@gmail.com> | 2018-02-03 15:45:55 -0500 |
---|---|---|
committer | Determinant <ted.sybil@gmail.com> | 2018-02-03 15:45:55 -0500 |
commit | 86b1bab87e0a4049f6fc9d2fedec323556f5ef27 (patch) | |
tree | 27d68bb22c9e2a956b515bef326e1da65934eb67 /test.cpp | |
parent | 36f0bb49e5c3efbf9363b245e42ebdd74a0ab9ee (diff) |
eliminate the need for promise::None
Diffstat (limited to 'test.cpp')
-rw-r--r-- | test.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -59,9 +59,12 @@ int main() { return 12; }).then(f).then(a1).fail(a2).then(b1).fail(b2).then(g).then(a3, b3) .then([](int x) { - puts("void return will automatically yield promise::none"); + puts("void return is ok"); }).then([]() { - puts("void parameter will automatically be promise::None"); + puts("void parameter is ok"); + return 1; + }).then([]() { + puts("void parameter will ignore the returned value"); }); auto p1 = promise_t([&t4](promise_t pm) { @@ -94,7 +97,6 @@ int main() { }) .then([](const promise::values_t values) { printf("finally %d\n", any_cast<int>(values[1])); - return promise::none; }); puts("calling t"); t4(); |