Is there a reason for the absence of an isAllocator
trait under std.experimental.allocator
?
Thread overview | ||||||
---|---|---|---|---|---|---|
|
September 04, 2021 Absence of isAllocator trait | ||||
---|---|---|---|---|
| ||||
September 06, 2021 Re: Absence of isAllocator trait | ||||
---|---|---|---|---|
| ||||
Posted in reply to Per Nordlöw | On Saturday, 4 September 2021 at 19:43:27 UTC, Per Nordlöw wrote: >Is there a reason for the absence of an I had ask a similar Q once and I've been told that (more or less): It's because the clients of an allocator should rather statically check for specific traits of an allocator, there are too many possible permutations of capabilities possible, not all can allocate and deallocate, not all can reallocate, and so on. actually I'm 100% sure that what you want is |
September 06, 2021 Re: Absence of isAllocator trait | ||||
---|---|---|---|---|
| ||||
Posted in reply to Basile B. | On Monday, 6 September 2021 at 13:24:56 UTC, Basile B. wrote: >It's because the clients of an allocator should rather statically check for specific traits of an allocator, there are too many possible permutations of capabilities possible, not all can allocate and deallocate, not all can reallocate, and so on. According to the documentation, there are two required properties all allocators must have:
So it makes sense to have an |
September 06, 2021 Re: Absence of isAllocator trait | ||||
---|---|---|---|---|
| ||||
Posted in reply to Paul Backus | On Monday, 6 September 2021 at 15:46:52 UTC, Paul Backus wrote: >
Should be
Thanks. Here's what I have so far
|