Article View: comp.std.c++
Article #3475default template args in a typedef
From: Tim Hollebeek
Date: Mon, 19 Feb 1996 02:23
Date: Mon, 19 Feb 1996 02:23
35 lines
1471 bytes
1471 bytes
Is this legal?
-------
template <class T>
class X {
};
template <class T, class U = X<T> >
class Y {
};
typedef Y<double, X<double> > Z1;
typedef Y<double> Z2;
int main() {
Z1 z1;
Z2 z2; // <--- here
}
-------
g++ 2.7.2 doesn't mind Z1, but gives:
aggregate `Y<...> z2' has incomplete type and cannot be initialized
on the Z2 line.
---------------------------------------------------------------------------
Tim Hollebeek | Disclaimer :=> Everything above is a true statement,
<space for rent> | for sufficiently false values of true.
Princeton Univ. | email: tim@wfn-shop.princeton.edu
-------------------| http://wfn-shop.princeton.edu/~tim (NEW! IMPROVED!)
---
[ comp.std.c++ is moderated. Submission address: std-c++@ncar.ucar.edu.
Contact address: std-c++-request@ncar.ucar.edu. Moderation policy:
http://reality.sgi.com/employees/austern_mti/std-c++/policy.html. ]
Technical Details
Message-ID:
<4g5ddd$56t@cnn.Princeton.EDU>Path:
arc1-ca.pugleaf.net!in2.uu.net!bounce-backShow Full Headers
Complete Article Headers
From: tim@franck.Princeton.EDU (Tim Hollebeek) Message-ID: <4g5ddd$56t@cnn.Princeton.EDU> X-Original-Date: 17 Feb 1996 20:22:05 GMT Path: arc1-ca.pugleaf.net!in2.uu.net!bounce-back Date: 19 Feb 96 02:23:48 GMT Approved: fjh@cs.mu.oz.au Newsgroups: comp.std.c++ Subject: default template args in a typedef Organization: Princeton University X-Newsreader: TIN [version 1.2 PL2] X-Auth: PGPMoose V1.1 PGP comp.std.c++ iQBFAgUBMSffQOEDnX0m9pzZAQHvUQF9E/SV4/M+SZ7MTeCeYaJ7t3i6nTKCdXlD 6At3RLfrJGkc7ht7ybJDEKU4gewisi4m =tY3B