Absence of isAllocator trait

Basile B. b2.temp at gmx.com
Mon Sep 6 13:24:56 UTC 2021


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 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 `isMallocator` and 
not `isAllocator` ;)


More information about the Digitalmars-d-learn mailing list