www.digitalmars.com         C & C++   DMDScript  

D - Re: template classes


    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 {
    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


     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

 see "Bug: implement" comment and a assert(0) statement.

     Best regards,
     Daniel Yokomiso.

Nov 19 2002