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,065 of 33,346   
   Johannes Schaub to All   
   Re: Pack expansion vs multiple parameter   
   29 Mar 12 20:47:43   
   
   bb2439ee   
   From: schaub.johannes@googlemail.com   
      
   Am 29.03.2012 23:05, schrieb Nikolay Ivchenkov:   
   > 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:   
   >   
      
   > Is there any reason why such a code should be rejected?   
   >   
      
   I don't know the internal reason of why they rejected this (expanding a   
   parameter pack into a fixed-parameters template parameter list). But the   
   C++11 Standard always has supported it.   
      
   GCC implemented this in GCC4.7 and clang recently added this feature in   
   SVN ( see my PR here: http://llvm.org/bugs/show_bug.cgi?id=9021 ).   
      
      
   --   
         [ 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