i’ve a category that generates a pseudorandom quantity.
i have to run the pseudorandom quantity generator perform each in a constexpr perform (i would like it to generate it at compile-time) and through run-time
it really works completely, however i’m questioning if there’s some option to do the next:
i desire a single perform that generates the quantity and that i can inform wether i would like it at compile or run time. that’s as a result of if i write 2 totally different ones, i’ve to rewrite the identical code twice and it makes it barely much less intuitive to make use of
i’ve considered utilizing outline like this:
#ifdef COMPILETIME int constexpr perform(); #else int perform(); #endif
however the entire defines are world. i cant simply undefine and redefine them every time I would like troughout the code
is there a way i can obtain this or am i perpetually doomed to make use of 2 separate features?