Use case: eliminate hidden allocations in buildPath

monarch_dodra monarchdodra at gmail.com
Thu Dec 5 01:06:06 PST 2013


On Thursday, 5 December 2013 at 08:59:08 UTC, Jacob Carlborg 
wrote:
> On 2013-12-05 09:52, monarch_dodra wrote:
>
>> How do you mean? As in functions that only output a "single 
>> item"?
>
> Yes.

I'd say simply with pass by ref, where the caller for puts the 
object on the stack (or wherever it wishes). If the object needs 
to further allocate, the said object itself should know how to it.

In the use case where you *must* have a "foo(ref T* o)"-style 
signature, I'm not sure.


More information about the Digitalmars-d mailing list