Skip to content

Comment on How to trick C/C++ compilers into generating terrible code?parent

Comments

"pure" in D causes the compiler to disallow, within that function, writes or reads from global mutable data. This inevitably follows from the principle that if you pass the same arguments to a pure function, you'll get the same result returned.

A pure function is still allowed to allocate memory, though, and throw an exception.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.