🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c++
Article #2870

Re: Class template specialization ?

#2870
From: John Max Skaller
Date: Wed, 06 Dec 1995 16:53
32 lines
1752 bytes
mlahteen@cs.Helsinki.FI (Mia Lahteenmaki) (almost) wrote:

template<class T> class Ref {...}; 

template<class T1> class Collection {...};
  // primary template

template<class T1> class Collection<Ref<T> > {...};  
  // specialisation

---> is correct as you wrote it. However, I wouldn't
advise doing this particular specialisation!

It isn't necessary, your "Ref<T>" class(es) should do
all the work. You could consider a container adaptor
instead.

BTW: you CAN'T specialise standard library templates;
if you do you release your compiler from any obligation
to operate correctly. 

-- 
John Max Skaller               voice: 61-2-566-2189
81 Glebe Point Rd              fax:   61-2-660-0850
GLEBE NSW 2037                 email: maxtal@suphys.physics.oz.au
AUSTRALIA                      email: skaller@maxtal.com.au



[ 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: <4a4hc2$1qb@oznet03.ozemail.com.au>
Path: arc1-ca.pugleaf.net!engnews1.Eng.Sun.COM!taumet!clamage
References: <49ssga$2eu@hydra.cs.Helsinki.FI>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!engnews1.Eng.Sun.COM!taumet!clamage
From: John Max Skaller <maxtal@suphys.physics.su.oz.au>
Newsgroups: comp.std.c++
Subject: Re: Class template specialization ?
Date: 6 Dec 1995 16:53:44 GMT
Organization: MAXTAL
Approved: clamage@eng.sun.com (comp.std.c++)
Message-ID: <4a4hc2$1qb@oznet03.ozemail.com.au>
References: <49ssga$2eu@hydra.cs.Helsinki.FI>
NNTP-Posting-Host: taumet.eng.sun.com
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"; conversions="7bit"
Content-Transfer-Encoding: 7bit
X-Nntp-Posting-Host: slsyd4p16.ozemail.com.au
X-Mailer: Mozilla 1.2N (Windows; I; 16bit)
X-Lines: 28
Content-Length: 823
Originator: clamage@taumet