MCPcopy Create free account
hub / github.com/Dobiasd/FunctionalPlus / fibo_cont

Function fibo_cont

test/composition_test.cpp:31–37  ·  view source on GitHub ↗

version using continuation passing style (CPS)

Source from the content-addressed store, hash-verified

29}
30// version using continuation passing style (CPS)
31std::uint64_t fibo_cont(const std::function<std::uint64_t(std::uint64_t)>& cont, std::uint64_t n)
32{
33 if (n < 2)
34 return n;
35 else
36 return cont(n - 1) + cont(n - 2);
37}
38}
39
40class CompositionTestState {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected