| ▲ | tyromaniac 4 hours ago | |||||||
I haven't tried it and am afk rn but I'd imagine you just define a constexpr function that implements collatz and use that in your contract. (Edit: if the input is constexpr itself) Its also quire easy to think about specializing a few templates and doing it that way. If you look up an example of the fib sequence in c++ templates you'll get the general idea. | ||||||||
| ▲ | kelseyfrog 3 hours ago | parent [-] | |||||||
I feel like I'd have something to learn from seeing the code. Won't you just run into a constexpr evaluation depth error with a suggestion to set -fconstexpr-depth? I don't see how this is the gotcha it's made out to be. | ||||||||
| ||||||||