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 - template instatiation inside another template

↑ ↓ ← "Daniel Yokomiso" <daniel_yokomiso yahoo.com.br> writes:
Hi,

    The following code doesn't compile with dmd 0.49 (didn't compile with
0.48 either):

module bug;
template A(T) {
    T id(T t) {
        return t;
    }
}

module bug2;
import bug;
template B(T) {
    private instance A(T) a;
    T same(T t) {
        return a.id(t);
    }
}
int main() {
    instance B(int) b;
    printf("%d\r\n", b.same(10));
    return 0;
}

    It gives the message "symbol __anonymous '__anonymous' has no semantic
routine" after semantic3 in bug2 module.


    Best regards,
    Daniel Yokomiso.
"I'm less of a neurotic perfectionist than I was. But I don't think that
anyone who has done good work in their life isn't a perfectionist. You have
to be."

- John Cleese
Nov 19 2002
↑ ↓ → "Walter" <walter digitalmars.com> writes:
I'll have a look. -Walter
Nov 19 2002