On Tuesday, 1 December 2015 at 08:58:56 UTC, BBaz wrote:
I think that `is(CAllocatorImpl!Alloc)` should work too then.

According to the 'is' version, int is an allocator. No idea why it thinks this works...

enum isAllocator(Alloc) = is(CAllocatorImpl!Alloc);
static assert(isAllocator!int);

This seems to work well though...
enum isAllocator(Alloc) = __traits(compiles, {IAllocator alloc = new CAllocatorImpl!Alloc;});

static assert(isAllocator!Mallocator);
static assert(isAllocator!GCAllocator);
static assert(!isAllocator!int);

Reply via email to