typedef behavior

Alex sascha.orlov at gmail.com
Sat Feb 10 02:55:26 UTC 2018


On Saturday, 10 February 2018 at 02:08:50 UTC, Alex wrote:
> Inside of the struct E I define more then one static array. 
> Namely, one for each Typedef I plan to instantiate. The 
> Typedefs have to be known at compile time, so the amount of 
> them has to be known by me :)
> Then, during the initialization, I work only with one of the 
> arrays of E, depending on the Typedef I use.
> During the work inside of E, the object will have to check, 
> which array was initialized and cooperate with this array, as 
> this is the only possibility.

Hmm... No. As the arrays are shared all of them will be 
initialized for every Typedef and the last point (decision during 
the work inside of a single Typedef) can not be achieved. So... 
there has to be another indirection, which will be filled during 
(possibly static) initialization.


More information about the Digitalmars-d-learn mailing list