`clear`ing a dynamic array

Shriramana Sharma via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Oct 25 03:53:14 PDT 2015


Thanks all, for your replies.

Jonathan M Davis via Digitalmars-d-learn wrote:

> If you want a container rather than a dynamic array - especially if you're
> looking for full reference semantics - then use std.container.array.Array.

Hmmm, pardon me but while I'm sure I don't specifically require reference 
semantics, I'm not sure how you mean to contrast a "container" vs a "dynamic 
array". Both are aware of their content count and both are iterable, no? Is 
it that by "container" you mean that something that owns its contents and is 
responsible for deleting them all when it itself is deleted?

-- 
Shriramana Sharma, Penguin #395953


More information about the Digitalmars-d-learn mailing list