constexpr int Fibonacci(int n) { //cout << "Executed Fib" << endl; switch (n) { case 0: return 0; case 1: return 1; default: return Fibonacci(n - 1) + Fibonacci(n - 2); } }
int main() { static_assert(Fibonacci(5) == 7, "Bad Program"); ///... }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)