digitalmars.D.learn - opSlice question
- Ant (26/26) Oct 02 2005 class A
- Hasan Aljudy (4/33) Oct 02 2005 should be:
- Ant (3/7) Oct 02 2005 thanks, time to go to sleep... :p
class A { A opSlice() { return new A(); } A opSlice(int a, int b) { return new A(); } } void main() { A a = new A(); A aa = a[1,2]; } dmd slice.d -I~/dmd/src/phobos slice.d(19): no [] operator overload for type slice.A What's wrong here? the code or DMD? thanks, Ant
Oct 02 2005
Ant wrote:class A { A opSlice() { return new A(); } A opSlice(int a, int b) { return new A(); } } void main() { A a = new A(); A aa = a[1,2]; } dmd slice.d -I~/dmd/src/phobos slice.d(19): no [] operator overload for type slice.A What's wrong here? the code or DMD? thanks, Antoff the top of my head I see this problem:A aa = a[1,2];should be: #A aa = a[1..2]
Oct 02 2005