6 ms·
constexpr functions are not inlined in debug builds. They can't be: the whole point of debug builds is that you can attach a debugger and step through the code.
by OskarS 7y ago
constexpr functions are not inlined in debug builds. They can't be: the whole point of debug builds is that you can attach a debugger and step through the code.
Illustration, compare the assembly for "foo1" and "foo2": https://godbolt.org/z/t9Zkx- https://godbolt.org/z/t9Zkx-
- banachtarski 7y agoAh ok, my mistake, I read "debug" as "-g" not "-O0." I generally run with optimizations on but with symbols.
- gpderetta 7y agoFor what is worth they are optimized out with -Og (if that doesn't count as debug build I don't know what does).