Return a dynamic array: real bug!

Gilles G. schaouette at free.fr
Wed Jul 4 04:47:19 PDT 2007


> These lines have totally different meanings. The first 'a' is allocated on the 
> heap, the second one on the stack. It has nothing to do with in/out/body.
You did not read my entire post, did you? ;-)
Let me explain once again then.
This doesn't compile, and this is _normal_:
int[] test()
{
    int a[2];
    return a;
}
But this does compile and should obviously not!
int[] test()
in{}
out{}
body
{
    int a[2];
    return a;
}

Therefore, there _is_ a problem with in/out/body.
--
Gilles


More information about the Digitalmars-d-learn mailing list