January 09, 2003 template bug | ||||
---|---|---|---|---|
| ||||
template <class T> struct N { }; template <class T> struct L { ~L() { int i = sizeof(N<T>); } }; template <typename T> inline void checked_delete(T * x) { typedef char type_must_be_complete[sizeof(T)]; delete x; } template<typename T> struct S { public: template<typename Y> void f(Y y) { checked_delete<T>((T *) 0); } }; struct A { void f(); void g(); }; inline void A::f() { S<L<int> > i; i.f(0); } // Error: ';' expected following '}' of definition of class 'N<int >' inline void A::g() { } int main() { A a; a.f(); return 0; } Occurs when trying to compile Boost's signals library. Workaround is to add the "missing" ';'. BTW, should these bug reports be posted here or in c++.beta? bye, Christof -- http://cmeerw.org JID: cmeerw@jabber.at mailto cmeerw at web.de ...and what have you contributed to the Net? |
January 09, 2003 Re: template bug | ||||
---|---|---|---|---|
| ||||
Posted in reply to Christof Meerwald | "Christof Meerwald" <cmeerw@web.de> wrote in message news:avjt6h$1k7h$1@digitaldaemon.com... > BTW, should these bug reports be posted here or in c++.beta? When I put out the next beta, yes. |
Copyright © 1999-2021 by the D Language Foundation