On Tuesday, 13 September 2016 at 03:33:04 UTC, Ivy Encarnacion wrote:
Can pure functions throw exceptions on its arguments?

You can throw exceptions for whatever reasons from a function marked pure:

void foo() pure
{
        throw new Exception("nope");
}

void main()
{
        foo();
}

Also, how can it perform impure operations?

Well, the point of pure is to restrict you from doing that. Is there something specific you're trying to do?

Reply via email to