On 16/04/2016 12:40, Marc Schütz wrote:
What are the plans for DIP25's `return` attribute? Because with it, the
compiler has enough information to know that the return value aliases `s`:

const(T)[] replaceSlice(T)(const(T)[] s return, in T[] slice, in T[]
replacement);

If the function is passed a mutable `s`, its return value can be
implicitly convertible to `T[]`.

AIUI, functions don't have to return part of the parameter tagged with return, it can return anything.

See:
http://wiki.dlang.org/DIP25#Types_of_Result_vs._Parameters

Reply via email to