Re:C++17 constexpr everything, or as much as the compiler can
by AlexeyBrin on Thursday December 28, 2017 @07:45AM
(#16021716)
A constexpr function can be used with a non-constexpr argument in which case the compiler will keep the function in the compiled code and you can use it as a normal function.
In the context of the linked article, take the first example and modify it, by reading a number at runtime with std::cin and call factorial or fibonacci with this number as an argument.
In the context of the linked article, take the first example and modify it, by reading a number at runtime with std::cin and call factorial or fibonacci with this number as an argument.
Something like this https://godbolt.org/g/CT5M6f