Thread overview
Problems with member templates
Dec 10, 2003
W³odzimierz Skiba
Jan 20, 2004
Wlodzimierz Skiba
Jan 20, 2004
Walter
Jan 21, 2004
W³odzimierz Skiba
Jan 22, 2004
Walter
December 10, 2003
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
January 20, 2004
In article <br792o$j5n$1@digitaldaemon.com>, W³odzimierz 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


January 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³odzimierz 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
>
>


January 21, 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
January 22, 2004
"W³odzimierz 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:
> > 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

Ah, no, it'll do fine. My mistake.