www.digitalmars.com         C & C++   DMDScript  

D - More opSlice Overloads

reply "Rupert Millard" <rupertamillard hotmail.DELETE.THIS.com> writes:
Walter,

I believe two more operator overloads are required to complement existing
ones. They are:

int opSlice(int x, int y, int[] value); // overloads a[i .. j] = b[]
int opSlice(int[] value);  // overloads a[] = b[]

I am prepared to admit that while the first is a necessity, the second is
just for completeness' sake, however I think that's a good enough reason to
have it.

The precedents for their inclusion are:

     int opIndex(int i, int value);
     int opSlice();  // overloads a[]
     int opSlice(int x, int y); // overloads a[i .. j]

and the slice semantics for arrays.

Thank you,

Rupert
Dec 19 2003
parent "Walter" <walter digitalmars.com> writes:
"Rupert Millard" <rupertamillard hotmail.DELETE.THIS.com> wrote in message
news:brvgha$21n8$1 digitaldaemon.com...
 Walter,

 I believe two more operator overloads are required to complement existing
 ones. They are:

 int opSlice(int x, int y, int[] value); // overloads a[i .. j] = b[]
 int opSlice(int[] value);  // overloads a[] = b[]

 I am prepared to admit that while the first is a necessity, the second is
 just for completeness' sake, however I think that's a good enough reason
to
 have it.

 The precedents for their inclusion are:

      int opIndex(int i, int value);
      int opSlice();  // overloads a[]
      int opSlice(int x, int y); // overloads a[i .. j]

 and the slice semantics for arrays.
I'll check it out. -Walter
Dec 22 2003