c++.beta - Problems with member templates
- W這dzimierz Skiba (46/46) Dec 10 2003 I have some code which can be compiled fine with Borland, GCC, VC, Intel...
- Wlodzimierz Skiba (3/5) Jan 20 2004 Walter, any progress on this? How far the next beta or full release is?
- Walter (3/8) Jan 20 2004 I need a minimal example which reproduces the problem.
- W這dzimierz Skiba (5/6) Jan 21 2004 Is there anything wrong with minimal example posted at begining of this
- Walter (3/8) Jan 21 2004 Ah, no, it'll do fine. My mistake.
I have some code which can be compiled fine with Borland, GCC, VC, Intel and CodeWarrior compilers but not in DMC. Digital Mars compiler either has problems with member templates, automatic type deduction in member templates or problems with member function pointers. Below is minimal code which fail in last official 8.38 and last beta of 8.39 relases of DMC: class POVMS_Message; class MessageReceiver { protected: template<class T> class HandlerOO { typedef void (T::*HandlerPtr)(POVMS_Message&, POVMS_Message&, int); }; template<class T> class Handler { typedef void (T::*HandlerPtr)(void *, void *, int); }; MessageReceiver(void *); template<class T> void InstallFront(T *cptr, typename HandlerOO<T>::HandlerPtr hptr) { } template<class T> void InstallFront(T *cptr, typename Handler<T>::HandlerPtr hptr) { } }; class MessageOutput : public MessageReceiver { public: MessageOutput(void *); ~MessageOutput(); void InitInfo(void *, void *, int); }; MessageOutput::MessageOutput(void * context) : MessageReceiver(context) { InstallFront(this, &MessageOutput::InitInfo); } Error message is: c:\dm\bin\dmc -cpp -c -o -Ae ..\..\source\frontend\messageoutput.cpp InstallFront(this, &MessageOutput::InitInfo); ^ ..\..\source\frontend\messageoutput.cpp(38) : Error: ambiguous reference to symbol Had: MessageReceiver::InstallFront(T*,HandlerPtrHandlerOO<T>) and: MessageReceiver::InstallFront(T*,HandlerPtrHandler<T>) ABX
Dec 10 2003
In article <br792o$j5n$1 digitaldaemon.com>, W這dzimierz Skiba says...I have some code which can be compiled fine with Borland, GCC, VC, Intel and CodeWarrior compilers but not in DMC.Walter, any progress on this? How far the next beta or full release is? ABX
Jan 20 2004
I need a minimal example which reproduces the problem. "Wlodzimierz Skiba" <Wlodzimierz_member pathlink.com> wrote in message news:buji22$2tps$1 digitaldaemon.com...In article <br792o$j5n$1 digitaldaemon.com>, W這dzimierz Skiba says...I have some code which can be compiled fine with Borland, GCC, VC, Intel and CodeWarrior compilers but not in DMC.Walter, any progress on this? How far the next beta or full release is? ABX
Jan 20 2004
"Walter" <walter digitalmars.com> wrote in news:bukd6f$180i$2 digitaldaemon.com:I need a minimal example which reproduces the problem.Is there anything wrong with minimal example posted at begining of this thread? See http://www.digitalmars.com/drn-bin/wwwnews?c%2B%2B.beta/262 ABX
Jan 21 2004
"W這dzimierz Skiba" <abx abx.art.pl> wrote in message news:bulk3v$3oq$1 digitaldaemon.com..."Walter" <walter digitalmars.com> wrote in news:bukd6f$180i$2 digitaldaemon.com:Ah, no, it'll do fine. My mistake.I need a minimal example which reproduces the problem.Is there anything wrong with minimal example posted at begining of this thread? See http://www.digitalmars.com/drn-bin/wwwnews?c%2B%2B.beta/262
Jan 21 2004