April 25, 2016
On 4/24/16 6:40 AM, Nick Treleaven wrote:
> On Friday, 15 April 2016 at 18:46:01 UTC, Steven Schveighoffer wrote:
>> inout(T)[] overlap(T)(inout(T)[] r1, inout(T)[] r2)
>
> Might be nice if inout applied to template parameter types:
>
> T[] overlap(inout T)(T[] r1, T[] r2);
>
> If it wasn't for the virtual function issue, I wonder if inout would
> still be needed on runtime arguments given the above feature?

The only issue is that overlap being passed a mutable T[] could modify the data. This is the major deficiency with the template solution. As I've said before, if you don't care about advertisement of non-mutation, then inout doesn't really do much for you.

-Steve
1 2 3
Next ›   Last »