std.container.RedBlackTree versus C++ std::set

Namespace rswhite4 at googlemail.com
Thu Feb 14 02:58:18 PST 2013


> 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?


More information about the Digitalmars-d-learn mailing list