Phobos 3 Discussion Notes - 02-01-2024

Atila Neves atila.neves at gmail.com
Tue Feb 13 19:49:39 UTC 2024


On Monday, 12 February 2024 at 18:13:45 UTC, jmh530 wrote:
> On Monday, 12 February 2024 at 17:00:01 UTC, Atila Neves wrote:
>>     [...]
>
> I assume you mean `alias MyVec = Vector!(MyType, Mallocator);`.
>
> I'm not completely sure I'm getting to the heart of what you're 
> saying since your post is a bit sparse...but I'm doing my best.
>
> [...]

My point is that things going out of scope can trigger 
deallocations. You're right that passing the allocator is 
error-prone. That's why automem, unlike C++'s smart pointers, 
doesn't let you construct the thing and pass it in; it's more 
"tell me what you want and I'll construct it for you".


More information about the Digitalmars-d mailing list