diff options
author | Determinant <ted.sybil@gmail.com> | 2018-02-01 20:21:53 -0500 |
---|---|---|
committer | Determinant <ted.sybil@gmail.com> | 2018-02-01 20:21:53 -0500 |
commit | 25c438b9056e2dee99fcc8680a6c295df9aa939e (patch) | |
tree | f1d70b2354f63c76d2ed13c29f61fdc128b8adff /test.cpp | |
parent | e609deb93ca365b253efa2173ce83046835a8d84 (diff) |
...
Diffstat (limited to 'test.cpp')
-rw-r--r-- | test.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -1,6 +1,7 @@ #include <string> #include "promise.hpp" using promise::promise_t; +using promise::any_cast; struct A { int operator()(int x) { @@ -75,9 +76,9 @@ int main() { auto p4 = promise::all(std::vector<promise_t>{p1, p2, p3}) .then([](const promise::values_t values) { - printf("%d %s %s\n", std::any_cast<int>(values[0]), - std::any_cast<std::string>(values[1]).c_str(), - std::any_cast<std::string>(values[2]).c_str()); + printf("%d %s %s\n", any_cast<int>(values[0]), + any_cast<std::string>(values[1]).c_str(), + any_cast<std::string>(values[2]).c_str()); return 100; }); @@ -87,7 +88,7 @@ int main() { return reason; }) .then([](const promise::values_t values) { - printf("finally %d\n", std::any_cast<int>(values[1])); + printf("finally %d\n", any_cast<int>(values[1])); return promise::none; }); puts("calling t"); |