memcpy() comparison: C, Rust, and D
Nordlöw via Digitalmars-d
digitalmars-d at puremagic.com
Tue Jan 31 11:32:58 PST 2017
On Tuesday, 31 January 2017 at 19:26:51 UTC, Walter Bright wrote:
> On 1/31/2017 2:44 AM, Nordlöw wrote:
>> On Tuesday, 31 January 2017 at 10:20:59 UTC, Olivier FAURE
>> wrote:
>>> I thought it meant "the parameter can be returned" not "the
>>> parameter *will*
>>> be returned".
>>
>> And what about multiple `return`-qualified function parameters?
>
> 'return' means treat the return value "as if" it was derived
> from that parameter. If multiple parameters are marked as
> 'return', treat the return value as if it was derived from one
> of them.
>
> This "as if" thing enables the designer of a function API to
> set the desired relationships even if the implementation is
> doing some deviated preversion with the data (i.e. a ref
> counted object).
Why is this feature used? Optimizations? Safety?
More information about the Digitalmars-d
mailing list