Skip to content

Commit

Permalink
example(co): add shared_task to examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Codesire-Deng committed Oct 2, 2023
1 parent b3083e6 commit 0e35854
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions example/when_any.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ task<int> f0() {
co_return 1;
}

task<const char *> f1() {
shared_task<std::string> f1() {
printf("f1 start.\n");
printf("f1 done.\n");
co_return "f1 Great!";
Expand All @@ -32,7 +32,7 @@ task<> run() {
overload{
[](std::monostate) { std::cout << "(void)\n"; },
[](int x) { std::cout << x << " : int\n"; },
[](const char *s) { std::cout << s << " : string\n"; },
[](const std::string &s) { std::cout << s << " : string\n"; },
},
var
);
Expand Down
4 changes: 2 additions & 2 deletions example/when_some.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ task<int> f0() {
co_return 0;
}

task<const char *> f1() {
shared_task<std::string> f1() {
printf("f1 start.\n");
printf("f1 done.\n");
co_return "f1 Great!";
Expand All @@ -32,7 +32,7 @@ task<> run() {
overload{
[](std::monostate) { std::cout << "(void)\n"; },
[](int x) { std::cout << x << " : int\n"; },
[](const char *s) { std::cout << s << " : string\n"; },
[](const std::string &s) { std::cout << s << " : string\n"; },
},
var
);
Expand Down

0 comments on commit 0e35854

Please sign in to comment.