Array of templated classes or structs

Dandyvica via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Oct 26 11:41:28 PDT 2015


On Saturday, 24 October 2015 at 19:02:50 UTC, TheFlyingFiddle 
wrote:
> On Saturday, 24 October 2015 at 19:00:57 UTC, TheFlyingFiddle 
> wrote:
>> One thing about variant is that if the struct you are trying 
>> to insert is larger then (void delegate()).sizeof it will 
>> allocate the wrapped type on the gc heap.
>
> This is not a concern if you want to have class templates as 
> they are on the heap anyways and have a fixed size.

Thanks TheFlyingFiddle! I've tought to using variants but not 
that way!

Seems an interesting path to follow...


More information about the Digitalmars-d-learn mailing list