From: daniel.kruegler@googlemail.com   
      
   On 2012-03-20 09:28, Timothy Madden wrote:   
   > On 20.03.2012 07:03, Daniel Krügler wrote:   
   >>> 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.   
      
   Now I'm completely confused given your original description where you wrote:   
      
   "I end up with a rather long construct to use throughout my   
   class:   
    base_class_name:: template templ_name "   
      
   Can you please provide a simple and self-explaining example?   
      
   > 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 ?   
      
   This has nothing to to with class templates, but with types instead. An   
   alias declaration always declares a type or a family of types (when a   
   template). How could this be related to function templates, which are   
   families of functions?   
      
   > 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...   
      
   Sure, it means that template I must refer to a type (family), anything   
   else could only be ill-formed. Should I have misunderstood what you are   
   trying to say, please elaborate in more detail.   
      
   HTH & Greetings from Bremen,   
      
   Daniel Krügler   
      
      
   --   
    [ 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)   
|