Nameless Static Array
Taylor Hillegeist via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Thu Jun 12 08:58:23 PDT 2014
So, Lately I have been avoiding the NEW keyword. I have recently
given up static allocation of classes using CTFE. I guess they
must be const or immutable? So naturally i can do most of what i
need to with structs. They are statically allocated no NEW
necessary. But without the NEW strategy. I must allocate static
arrays and set them to a pointer in my struct. Not too big of
deal really.
uint[12] Buffer;
R_R_Buffer RRB=R_R_Buffer(Buffer);
uint[24] OtherBuffer;
R_R_Buffer RRB2 = R_R_Buffer(OtherBuffer);
I feel though i might end up having OtherOtherOtherBuffers, and
it pollutes my local symbols. I just dont like it.
Is there a way to not give the buffer a name and do lika dis:
R_R_Buffer RRB=R_R_Buffer(uint[12]);
R_R_Buffer RRB2 = R_R_Buffer(uint[24]);
This obviously fails to compile, but i think you get the idea.
Mostly, I don't care what the static array name is.
More information about the Digitalmars-d-learn
mailing list