Topic: Explicit instantiation of struct/class


Author: Tom Houlder <thoulder@icor.fr>
Date: 1997/01/20
Raw View
G++ accepts that a template class is explicitly instantiated as a
template struct and vice versa.

Example:

template <class T>
struct S { // ... };

template <class T>
class C { // ... };

template class S<int>;
template struct C<double>;

The types S<int> and C<double> have now been explicitly instantiated.

According to the standard, are the two explicit instantiations legal?


Tom

Tom Houlder
thoulder@icor.fr
---
[ comp.std.c++ is moderated.  To submit articles: Try just posting with your
                newsreader.  If that fails, use mailto:std-c++@ncar.ucar.edu
  comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
  Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
  Comments? mailto:std-c++-request@ncar.ucar.edu
]