20 ms·
Why not use a static local constexpr? That seems like it would be faster to me due to not needing to allocate stack space and copy the value to the stack. You s
by Thorrez 3y ago
Why not use a static local constexpr? That seems like it would be faster to me due to not needing to allocate stack space and copy the value to the stack. You still get the benefit of not needing a global.
- elteto 3y agoIf the variable is numeric, and const or constexpr, and you have -O1 or higher enabled, then the compiler will optimize it away. I don’t think static would add anything under these conditions.