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.

Reply via email to