www.digitalmars.com Home | Search | C & C++ | D | DMDScript | News Groups | index | prev | next
Archives

D Programming
D
D.gnu
digitalmars.D
digitalmars.D.bugs
digitalmars.D.dtl
digitalmars.D.dwt
digitalmars.D.announce
digitalmars.D.learn
digitalmars.D.debugger

C/C++ Programming
c++
c++.announce
c++.atl
c++.beta
c++.chat
c++.command-line
c++.dos
c++.dos.16-bits
c++.dos.32-bits
c++.idde
c++.mfc
c++.rtl
c++.stl
c++.stl.hp
c++.stl.port
c++.stl.sgi
c++.stlsoft
c++.windows
c++.windows.16-bits
c++.windows.32-bits
c++.wxwindows

digitalmars.empire
digitalmars.DMDScript

D - More opSlice Overloads

↑ ↓ ← "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
↑ ↓ → "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

 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