Re: Absence of isAllocator trait

2021-09-06 Thread Per Nordlöw via Digitalmars-d-learn
On Monday, 6 September 2021 at 15:46:52 UTC, Paul Backus wrote: * `void allocate(size_t size)` Should be * `void[] allocate(size_t size)` Thanks. Here's what I have so far ```d enum isAllocator(T) = (is(typeof(T.allocate(size_t.init)) == void[]) &&

Re: Absence of isAllocator trait

2021-09-06 Thread Paul Backus via Digitalmars-d-learn
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

Re: Absence of isAllocator trait

2021-09-06 Thread Basile B. via Digitalmars-d-learn
On Saturday, 4 September 2021 at 19:43:27 UTC, Per Nordlöw wrote: Is there a reason for the absence of an `isAllocator` trait under `std.experimental.allocator`? 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

Absence of isAllocator trait

2021-09-04 Thread Per Nordlöw via Digitalmars-d-learn
Is there a reason for the absence of an `isAllocator` trait under `std.experimental.allocator`?