version using continuation passing style (CPS)
| 29 | } |
| 30 | // version using continuation passing style (CPS) |
| 31 | std::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 | |
| 40 | class CompositionTestState { |
nothing calls this directly
no outgoing calls
no test coverage detected