null Vs [] return arrays

Kagamin spam at here.lot
Mon Mar 28 05:10:13 PDT 2011


bearophile Wrote:

> Kagamin:
> 
> > [] is not null, it's an array of 0 elements, what is done exactly.
> > edx points to the allocated array.
> 
> I don't understand what you say. I think the caller of foo() and bar() receive the same thing, two empty registers. I think that cast(int[])null and cast(int[])[] are the same thing for D.

That's a mistake.

Well, if there's no differnce for you, you can use either of them. What's the problem?


More information about the Digitalmars-d-learn mailing list