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 32,030 of 33,346   
   Timothy Madden to All   
   Re: Is there a typedef or a using-declar   
   20 Mar 12 01:28:43   
   
   From: terminatorul@gmail.com   
      
   On 20.03.2012 07:03, Daniel Krügler wrote:   
   > Am 19.03.2012 21:09, schrieb Timothy Madden:   
   >> In many places in my class template I have to use a nested template from   
   >> a base class, with different template parameters. Since the base class   
   >> is dependent, I end up with a rather long construct to use throughout my   
   >> class:   
   >> base_class_name:: template templ_name    
   >   
   >> From your first description I guess you mean something like   
   >   
   > template   
   > struct A {   
   > template   
   > struct I {};   
   > };   
   >   
   > as dependent base class template and usage within B like this:   
   >   
   > template   
   > struct B : A {   
   > typedef A super_t;   
   > typename super_t::template I m;   
   > };   
   >   
   > Is this correct?   
      
   Yes, except I just want   
   	super_t::template I   
   and not   
   	super_t::template I   
   because I want to later specialize I with many different arguments.   
      
   Well I do not have gcc 4.7 yet (but 4.6.1 from MinGW), but I still have   
   a question:   
      
   Even with an alias-declaration, how does the compiler know if the named   
   template is a function template or a class template ? Or is the   
   alias-declaration only used for class templates ?   
      
      template    
   	using I = super_t::template I;   
      
   Recall that super_t is dependent, so   
   	super_t::template I   
   means just about nothing to the compiler...   
      
   { Trailing quotation removed. Please try to include only the minimum   
     necessary to establish the context. -mod }   
      
   --   
         [ 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