Methods for expanding class in another class/struct

IGotD- nise at nise.com
Sat Sep 26 10:13:01 UTC 2020


We know that classes are all reference typed so that classes must 
be allocated on the heap. However, this memory could be taken 
from anywhere so basically this memory could be a static array 
inside the class. This is pretty much what the scoped template 
does when allocating a class on the stack. In practice allocating 
a class inside another class could be done in similar fashion.

Do we have a good example showing how to expand a class inside 
another class?
Shouldn't be have a standard template similar to scoped, that 
statically allocates space inside the class? This template should 
be available in the standard library.


More information about the Digitalmars-d-learn mailing list