From -91920772930325004 X-Google-Thread: 7894ca11fe,e1019ee5aaa65968 X-Google-Attributes: gid7894ca11fe,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!news.giganews.com.POSTED!not-for-mail NNTP-Posting-Date: Sat, 12 Mar 2011 09:30:11 -0600 Return-Path: Sender: std-cpp-request@vandevoorde.com Approved: stephen.clamage@oracle.com Message-ID: Newsgroups: comp.std.c++ From: Noah Roberts Subject: Re: Specializing a template template-parameters with a template template class. Organization: Engineered Software Inc. References: <472cc17b-b5ee-4897-81e7-c52fe1b228ad@a11g2000pro.googlegroups.com> Content-Type: text/plain; charset="us-ascii" X-Original-Date: Fri, 11 Mar 2011 09:12:04 -0800 X-Submission-Address: std-c++-submit@vandevoorde.com To: undisclosed-recipients:; Date: Sat, 12 Mar 2011 09:26:40 CST Lines: 58 X-Usenet-Provider: http://www.giganews.com X-Trace: sv3-yd4FVtbLrwshpoVkBOSv4wb9zsBWp7YVAMKIedNJ4lHqzB9YUKZ7tcoClbVNefI5iTF6dUcIajULtgd!Vz0zsxdZcoipI4BpSClUeNccA5ivumePgsSZopemnJdxDLlwTZ+ujxNWYoIYuFRt2JkxY6gIG3Vn X-Complaints-To: abuse@giganews.com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 3078 Xref: g2news1.google.com comp.std.c++:3198 In article <472cc17b-b5ee-4897-81e7- c52fe1b228ad@a11g2000pro.googlegroups.com>, itajsherman@gmail.com says... > To demonstrate the problem: > > template< template< typename T > class > class A; > class B {}; > > template< typename T, typename U > class X {}; > //and hypothetic equivalent: > template< typename T > template < typename U > class Y {}; > //or > template< typename T > template < typename U > using Y = X< T, U >; > > Using the above hypothetical syntax, Y and X could be considered > equivalent X< T, U > == Y< T >< U >. > However, for any type T, Y is a template class (with 1 parameter), > and it might make sense to be able to specialize the first parameter > of A on Y: > > //hypothetically specialize: > template< typename T > class A< Y > {}; > //instanciated by A< Y > > > With X it's not possible to do such specialization. > > Nesting cannot solve that either: > > template< typename T > class Z > { > public: template< typename U > class R {}; > }; > > template< typename T > class A< Z::R > {}; > //cannot instanciate by A< Z::R > > > It's not possible to deduce T in a member template class Z::R. > > Has this ever been considered as a c++ feature? > > itaj In the new standard you'll be able to use template aliases and your unworkable attempt to work around the non-existence of such will no longer be an issue. -- http://crazycpp.wordpress.com/ [ comp.std.c++ is moderated. To submit articles, try posting with your ] [ newsreader. If that fails, use mailto:std-cpp-submit@vandevoorde.com ] [ --- Please see the FAQ before posting. --- ] [ FAQ: http://www.comeaucomputing.com/csc/faq.html ]