Error: functions cannot return static array float[4u][4u]

Jason House jason.james.house at gmail.com
Thu Feb 21 15:37:08 PST 2008


Jarrett Billingsley wrote:

> "Jason House" <jason.james.house at gmail.com> wrote in message
> news:fpl144$hco$2 at digitalmars.com...
> 
>> I don't know why I said heap instead of stack, but I should have said
>> stack.
> 
> Fair enough :) but your snippet is still valid as the class/struct C is
> returned by value.

you're totally right.  I had way too many errors in one post.  Thankfully
this is a D newsgroup and nobody will notice ;)  I should have made the
return type C&.  This is common practice in C++ to avoid copying the class.


More information about the Digitalmars-d-learn mailing list