Is it legal to have a function taking two aliased slices?

Steven Schveighoffer via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Jul 10 06:54:47 PDT 2015


On 7/10/15 9:20 AM, ponce wrote:
>
> Example:
>      void process(float[] input, float[] output)
>      {
>        // do stuff
>      }
>
>
> I'd like to sometimes have overlapping slices, and don't want the
> compiler to assume they do not overlap.
>
>

Yes, it's legal, and the compiler doesn't assume anything about the two 
slices, including whether they overlap or not.

-Steve


More information about the Digitalmars-d-learn mailing list