constexpr void X() {
/* code, that can be executed at compiletime */
}
void X() {
/* code, that does the same as above, but is optimized for runtime, eg.
including caching, assembler code, ... to optimize runtime performance */
}
As demostrated above, I want two functions, both basically doing the same thing, one optimized for runtime, one for compile-time. In my example, the runtime version involves caching, which cannot be done in constexpr, but could improve performance at runtime.
Can this be achieved somehow (using C++14)?
If this can only be achieved using compiler-specific solutions, they're ok too, but I would prefer a standard solution (currently, I am unaware of one)