Any type_traits or method could find out the parameters is a constexpr or not?
Example
size_t fibo_runtime(size_t num)
{
//implementation
}
constexpr size_t fibo(size_t num)
{
return is_constexpr<size_t>::value ? //this type traits looks weird and unreasonable
(num > 1 ? fibo(num - 1) * num : 1) :
fibo_runtime(num);
}
constexpr could apply on constexpr parameter and the parameter be determined at run time. However, recursive may not efficient enough on runtime.
Do we have anyway to separate the implementation of runtime and compile time of constexpr functions? if we could not do that, could we enforce the users could not use the constexpr function to do some runtime evaluation?