Prevent copy of range in foreach

pineapple via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Aug 31 08:10:20 PDT 2016


On Wednesday, 31 August 2016 at 14:03:20 UTC, Yuxuan Shui wrote:
> I want to make a hash table that uses std.experiment.allocator. 
> The bucket is allocated from an allocator, and freed in 
> ~this(). I don't want to copy the whole bucket in this(this).
>
> Maybe I should use a reference counter or something?
>

A reference counter should solve the problem, but there's also 
the option of just making it a class instead of a struct


More information about the Digitalmars-d-learn mailing list