What can _not_ be marked pure?

ag0aep6g via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Mar 9 02:13:35 PST 2016


On 09.03.2016 10:57, Guillaume Piolat wrote:
> Another question that ensues is: will the compiler prevent incorrect use
> of pure, so that it's safe to spam it in your code?

The compiler should catch wrong usage of `pure`, yes. Function 
declarations without implementation are an exception, of course. Same 
with `nothrow`, `@safe`, and `@nogc`. The compiler can't check 
`@trusted` for correctness, obviously.


More information about the Digitalmars-d-learn mailing list