Is this function pure?

Janice Caron caron800 at googlemail.com
Tue Sep 18 16:39:29 PDT 2007


On 9/19/07, Bruno Medeiros <brunodomedeiros+spam at com.gmail> wrote:
> Can you give another example? The one you gave:
>
> > int definitelyNotPure()
> > {
> >     int x;
> >     return cast(int)&x;
> > }
> >
> >
>
> is invalid even for non-pure functions.

If you insist...

int definitelyNotPure()
{
    auto x = new int[1];
    return cast(int)&x;
}



More information about the Digitalmars-d mailing list