www.digitalmars.com         C & C++   DMDScript  

D - template classes

reply "Daniel Yokomiso" <daniel_yokomiso yahoo.com.br> writes:
Hi,

    When will be template classes available? Right now a simple Pair
template class doesn't work. When I try to compile the following error
occurs: "Assertion failure: '0' on line 809 in file 'func.c'". In func.c we
see "Bug: implement" comment and a assert(0) statement.

    Best regards,
    Daniel Yokomiso.
Nov 08 2002
next sibling parent "Daniel Yokomiso" <daniel_yokomiso yahoo.com.br> writes:
Hi,

    I've got other template bug. In a template class with a invariant we got
the following message when compiling: "Assertion failure: '0' on line 1070
in file 'func.c'". The code used is:


template A(T) {
    class B {
        invariant {
            assert(1);
        }
    T id(T t) {
        return t;
    }
    }
}
int main() {
    instance A(int) a;
    a.B b = new B();
    printf("%d\r\n", b.id(10));
    return 0;
}


    Best regards,
    Daniel Yokomiso.

"Programming in Basic causes brain damage."
- Edsger W. Dijkstra

----- Original Message -----
From: "Walter" <walter digitalmars.com>
To: "Daniel Yokomiso" <daniel_yokomiso yahoo.com.br>
Sent: Monday, November 18, 2002 4:27 PM
Subject: Re: template classes


 Fixed, thanks. -Walter

 ----- Original Message -----
 From: "Daniel Yokomiso" <daniel_yokomiso yahoo.com.br>
 Newsgroups: D
 Sent: Friday, November 08, 2002 5:05 AM
 Subject: template classes


 Hi,

     When will be template classes available? Right now a simple Pair
 template class doesn't work. When I try to compile the following error
 occurs: "Assertion failure: '0' on line 809 in file 'func.c'". In func.c
we
 see "Bug: implement" comment and a assert(0) statement.

     Best regards,
     Daniel Yokomiso.
Nov 19 2002
prev sibling parent "Walter" <walter digitalmars.com> writes:
This one is corrected in 0.50. -Walter

"Daniel Yokomiso" <daniel_yokomiso yahoo.com.br> wrote in message
news:aqg8r4$tev$1 digitaldaemon.com...
 Hi,

     When will be template classes available? Right now a simple Pair
 template class doesn't work. When I try to compile the following error
 occurs: "Assertion failure: '0' on line 809 in file 'func.c'". In func.c
we
 see "Bug: implement" comment and a assert(0) statement.

     Best regards,
     Daniel Yokomiso.
Nov 19 2002