Commit 681adfbf authored by Xavier Thompson's avatar Xavier Thompson

Add test_discard.cpp

parent 47f10b10
#include <task.hpp>
#include <cstdio>
using namespace typon;
task<int> add(int a, int b) {
printf("add(%d, %d)\n", a, b);
co_return a + b;
}
task<int> call_add_but_ignore_result(int a, int b) {
co_await add(a, b).discard();
co_return 1;
}
int main() {
call_add_but_ignore_result(2, 3).call_discard();
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment