Commit 44a8eeda authored by Xavier Thompson's avatar Xavier Thompson

WIP Adapt main.cpp and loop.cpp

parent f08fef65
#include <task.hpp>
#include <root.hpp>
#include <cstdio>
......@@ -17,12 +16,8 @@ task<int> loop(int n) {
co_return result;
}
root f() {
int result = co_await loop(100000000);
int main() {
int result = loop(100000000).call();
printf("%d\n", result);
}
int main() {
f();
}
#include <task.hpp>
#include <root.hpp>
#include <cstdio>
......@@ -14,11 +13,7 @@ task<int> fibo(int n) {
co_return a + b;
}
root f() {
int result = co_await fibo(40);
printf("%d\n", result);
}
int main() {
f();
int result = fibo(40).call();
printf("%d\n", result);
}
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