Article View: comp.std.c++
Article #1977Re: Partial Template Specialization
From: Steve Clamage
Date: Fri, 15 Sep 1995 22:49
Date: Fri, 15 Sep 1995 22:49
33 lines
1516 bytes
1516 bytes
In article 95Sep15152129@physics2.Berkeley.EDU, Martin Hitz <hitz@ftp.univie.ac.at> writes:
>
>A while ago, Steve Clamage kindly pointed out to me that partial
>template specializations where allowed by the draft standard.
>
>Thus for a template
>
> template<class T, int n> class X { ... };
>
>it should be possible to explicitly specify a variant for, say,
>
> class X<class T, 1> { ... };
>
>where T is still a "free" formal parameter.
>Although I know that most compiler don't support this feature yet,
>I'am curious about the syntax of such a partial specialization
>(I don't think the above example is correct).
According to the way I read 14.6, class template specialization, [temp.class.spec]
you would write
template<class T> class X<T, 1> { ... }
---
Steve Clamage, stephen.clamage@eng.sun.com
---
[ comp.std.c++ is moderated. Submission address: std-c++@ncar.ucar.edu.
Contact address: std-c++-request@ncar.ucar.edu. The moderation policy
is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
Technical Details
Message-ID:
<MATT.95Sep15154934@physics2.Berkeley.EDU>Path:
arc1-ca.pugleaf.net!128.32.155.1!mattReferences:
<MATT.95Sep15152129@physics2.Berkeley.EDU>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!128.32.155.1!matt From: clamage@Eng.Sun.COM (Steve Clamage) Newsgroups: comp.std.c++ Subject: Re: Partial Template Specialization Date: 15 Sep 1995 22:49:34 GMT Organization: Sun Microsystems Inc. Approved: matt@physics2.Berkeley.EDU (Matt Austern) Message-ID: <MATT.95Sep15154934@physics2.Berkeley.EDU> References: <MATT.95Sep15152129@physics2.Berkeley.EDU> Reply-To: clamage@Eng.Sun.COM NNTP-Posting-Host: physics2.berkeley.edu