So I suppose I'm wondering why is it a bad thing to include the allocator as part of the type and why is it that it seems like in practice that's how it is done anyway.
I recall some talk Andrei did where he said it was a bad idea to
make the allocator part of the type. However, the container
library in dlang-community(says it is backed with
std.experimental.allocator) contains allocator as part of the
type. Automem does too. Honestly, I would think you would really
be hobbled if you didn't. For instance, if you want to expand a
DynamicArray using the built-in ~= operator, then you really need
to know what the allocator is. Without ~= you'd have to rely on
functions (maybe member functions, maybe not).
- Allocator Part of Type jmh530 via Digitalmars-d-learn
- Re: Allocator Part of Ty... Steven Schveighoffer via Digitalmars-d-learn
- Re: Allocator Part o... jmh530 via Digitalmars-d-learn
- Re: Allocator Pa... Steven Schveighoffer via Digitalmars-d-learn
- Re: Allocator Part of Ty... Eugene Wissner via Digitalmars-d-learn
- Re: Allocator Part o... jmh530 via Digitalmars-d-learn