home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.c++.moderated      Moderated discussion of C++ superhackery      33,346 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 33,132 of 33,346   
   heideggm@googlemail.com to All   
   What is necessary to make a template's m   
   21 Jul 13 19:57:12   
   
   { Please limit your text to fit within 80 columns, preferably around 70,   
     so that readers don't have to scroll horizontally to read each line.   
     This article has been reformatted manually by the moderator. -mod }   
      
      
   Good evening,   
      
   let's say, we have the following class templates:   
      
   template class MyClass   
   {   
           public:   
      
           void myMethod(T* myParam)   
           {   
               std::cout<<"Whatever."< class DerivedClass : public MyClass   
   {   
       public:   
      
           void myOtherMethod(T* myParam)   
           {   
                   myMethod(myParam);   
           }   
   };   
      
   Now I create an instance of DerivedClass and call myOtherMethod from it.   
   The compiler complaints that he cannot find myMethod in myOtherMethod   
   and wants me to use the this pointer.   
      
   My question is shouldn't the two phase name lookup recognize that   
   myMethod depends on the template argument (via T* myParam) and therefore   
   find it during the second phase?   
      
   Regards.   
      
      
   --   
         [ See http://www.gotw.ca/resources/clcm.htm for info about ]   
         [ comp.lang.c++.moderated.    First time posters: Do this! ]   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca