bb2439ee   
   From: no.spam.here@its.invalid   
      
   On 3/29/2012 2:05 PM, Nikolay Ivchenkov wrote:   
   > It seems that the following code should be well-formed   
   >   
   > template   
   > struct X   
   > {   
   > typedef typename X::type type;   
   > };   
   >   
   > template   
   > struct X   
   > {   
   > typedef void type;   
   > };   
   >   
   > int main() {}   
   >   
   > However, GNU C++ 4.8.0, Clang 3.0, and Intel C++ 12.1 issue errors at   
   > line 4:   
   >   
   > GNU C++ 4.8.0:   
   > error: wrong number of template arguments (1, should be 2 or more)   
   >   
   > Clang 3.0:   
   > error: too few template arguments for class template 'X'   
   > typedef typename X::type type;   
   > ^   
   > Intel C++ 12.1:   
   > error: too few arguments for class template "X"   
   > typedef typename X::type type;   
   > ^   
   >   
   > Is there any reason why such a code should be rejected?   
   >   
   >   
      
      
   Don't specialize at line 4. Just make it a new template.   
      
   template   
    struct X   
   {   
    typedef void type;   
   };   
      
      
   --   
    [ 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)   
|