Hacker News new | ask | show | jobs
by nickodell 2769 days ago
Everything above and including #define C1 returns a single value, and therefore could be done with constexpr.

More to the point, constexpr would be a heck of a lot more efficient - changing M4 to M5 increases the preprocesed size from 80 MB to 240 MB. This is an exponential increase, despite that a Mandlebrot pixel can be computed in linear time. (Linear to the maximum number of steps.)

I suspect that this is because if you write a macro and use your macro argument twice, this doubles the length of whatever your macro argument was.