Phobos addition formal review: std.experimental.allocator

Jacob Carlborg via Digitalmars-d digitalmars-d at puremagic.com
Tue Jul 14 04:25:55 PDT 2015


On 2015-07-12 18:10, Dmitry Olshansky wrote:

> But then a Parent allocator would like to know if the child actually
> doesn't support reallocate vs say failing to reallocate. In the former
> case a lot of extra logic is simply removed at compile-time.

Perhaps this is a simplified view, but most cases there were no 
difference between failing to reallocate or does not support reallocate.

"deallocate", for example, was used like this:

static if (hasMember!("deallocate"))
     deallocate();

No "else", no action was taken when it didn't support "deallocate". I 
haven't look through the whole source code.

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list