Comment

Comment by macgyverismo

Lovely article, I am amazed at the lengths compilers go through to get the best performance. Thanks for writing this!

Reading the part about pure functions (including the extension [[gnu::pure]]) made me feel that this is a part where the C++ default is actually wrong. Not just because it could be better/hindsight/other languages have it/etc. but because it is in conflict with its own motto, don't pay for what you don't use. I really hope I can enable a compiler flag some time in the future that would make my variables const, and my functions pure by default.

parent macgyverismo 11 months ago

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton