typedef behavior

Ali Çehreli acehreli at yahoo.com
Sat Feb 10 01:23:20 UTC 2018


On 02/09/2018 05:14 PM, Alex wrote:

 >> > struct E
 >> > {
 >> >      size_t i;
 >> >      static T[] tarr;
 >>
 >> To save time to others, note that 'tarr' is a static member that ends
 >> up being shared by two Typedef instantiations.
 >
 > Yup. They are shared by two Typedef instantiations with different 
cookies.
 >
 > So...
 > The question is two-fold:
 > Would it help to alter the init value of the Typedef?
 > If yes, how to alter it?
 > If no, is this a bug?

I think this is a limitation of Typedef.

I can't see a way out (at least one that can support any type E). It 
should be possible if you can modify E but I can't work something out now.

Ali



More information about the Digitalmars-d-learn mailing list