3 ms·
Probably but that would slow down compilation a lot.
by two_handfuls 2y ago
Probably but that would slow down compilation a lot.
- simlevesque 2y agoExactly, it's not like the constants are gonna change.
- blharr 2y agoYou wouldn't have to recompile them every time. What if you didn't necessarily use macros but auto-generated it in a file that you keep separate from the other code at the bottom?
- dataflow 2y agoWhat I would do in these cases is to define the general computation function, but special-case it to return the hard-coded value for specific common inputs if it's being evaluated at compile time. Then add a test to verify both behaviors.