struct S
{
    static struct Payload
    {
        //Tons of data here
    }
    Payload* _p;

    //fonctions
}

Ref counted is implemented that way. most of the containers are also implemented that way. associative arrays are also implemented that way under the hood.

But you have to allocate '_p' again on the heap.
I see no advantage over classes, except that these structures are just not null by default.
Is that the advantage?

Reply via email to