Commit ed250ff8 authored by Xavier Thompson's avatar Xavier Thompson

WIP main.cpp and Makefile

parent 9a089875
CXX=g++-11
CXXFLAGS=-g -O2 -Wall -Wextra -Werror -std=c++20 -fcoroutines -I.
CXXFLAGS=-g -O3 -Wall -Wextra -Werror -std=c++20 -fcoroutines -I.
......@@ -4,17 +4,15 @@
using namespace typon;
task<int> add(int a, int b) {
co_return a + b;
}
task<void> hello() {
puts("hello");
co_return;
task<int> fibo(int n) {
if (n < 2) {
co_return n;
}
co_return fibo(n - 1)._result.get() + fibo(n - 2)._result.get();
}
int main() {
hello();
int result = add(2, 3)._result.get();
int result = fibo(40)._result.get();
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