Article View: comp.std.c++
Article #2828Class template specialization ?
From: Mia Lahteenmaki
Date: Mon, 04 Dec 1995 16:30
Date: Mon, 04 Dec 1995 16:30
41 lines
2427 bytes
2427 bytes
The WP draft (28 April,1995) describes class template specializations
in 14.6 [temp.class.spec]. I would like to specialize
collection class to use smart pointer (Ref) element type.
The typical template instantiation is 'Collection<Ref<C>>'
where C is some class.
template<class T> class Ref {...};
//primary template
template<class T1> class Collection {...};
// How should I declare now the specialization ? Like this?
template<class T1> class Collection<Ref<T> > {...};
Would the above declaration be correct ?
I understand that the standard clause 7, first point:
"- A specialized nontype argument expression shall not involve a
template parameter of the specialization "
is now met.
My current compiler (MS Visual C++ 2.0) does not understand the
above declaration, but that does not say me much about
whether the declaration is standard compliant or not, of course.
Regards,
Mia
---------------------------------------------------------------------
Mia Lahteenmaki University of Helsinki
e-mail: mia.lahteenmaki@helsinki.fi Department of Computer Science
Tel : +358 0 7084 4246 P.O. Box 26
Fax : +358 0 7084 4441 FIN-00014 UNIVERSITY OF HELSINKI
FINLAND
---------------------------------------------------------------------
--
--------------------------------------------------------------------
Mia L{hteenm{ki Helsingin yliopisto
e-mail: mia.lahteenmaki@helsinki.fi Tietojenk{sittelytieteen laitos
Tel : (90) 7084 4246 PL 26 (Teollisuuskatu 23)
[ 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:
<49ssga$2eu@hydra.cs.Helsinki.FI>Path:
arc1-ca.pugleaf.net!engnews2.Eng.Sun.COM!taumet!clamageShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!engnews2.Eng.Sun.COM!taumet!clamage From: mlahteen@cs.Helsinki.FI (Mia Lahteenmaki) Newsgroups: comp.std.c++ Subject: Class template specialization ? Date: 4 Dec 1995 16:30:04 GMT Organization: University of Helsinki, Department of Computer Science Approved: clamage@eng.sun.com (comp.std.c++) Message-ID: <49ssga$2eu@hydra.cs.Helsinki.FI> NNTP-Posting-Host: taumet.eng.sun.com Content-Type: text Keywords: template, specialization X-Nntp-Posting-Host: hydra.helsinki.fi Content-Length: 1614 X-Lines: 37 Originator: clamage@taumet