On 09/02/2011 06:20 AM, dsimcha wrote:
== Quote from dsimcha ([email protected])'s article
== Quote from Timon Gehr ([email protected])'s article
Allocating a class or struct instance with a given allocator seems not
to be part of the standard allocator interface. Why is that?
Pure oversight. This should probably be fixed.
BTW, any suggestions for a name for a function like this? I can't think of a
good
one.
Best suited would be 'New', but that would probably be against Phobos
naming conventions (we could add an exception for names that would
otherwise be keywords):
alloc.New!MyClass(arg1, arg2);
with(alloc) New!MyClass(arg1, arg2);
Others:
'instanceAlloc' or 'newInstance' (or 'instAlloc' or 'newInst'):
alloc.instanceAlloc!MyClass(arg1, arg2);
alloc.newInstance!MyClass(arg1, arg2);
Just 'instantiate' or 'instance':
alloc.instantiate!MyClass(arg1, arg2);
alloc.instance!MyClass(arg1, arg2);