P
Patrick Kowalzick
Dear all,
the following code is illegeal (but compiles with MSVC 7.1):
// *** illegal ***
struct outer0 {
template<typename inner_var>
struct inner { };
template<>
struct inner<void> { };
};
// ***
but is the following legal (compiles with g++, comeau, MSVC7.1) ?
// *** legal ***
struct outer0 {
template<typename inner_var, typename hack = void>
struct inner { };
template<typename hack>
struct inner<void,hack> { };
};
// ***
Example copied from:
http://lists.debian.org/debian-gcc/2004/09/msg00015.html
There I found as well:
but it does not tell if its legal .
Regards,
Patrick
the following code is illegeal (but compiles with MSVC 7.1):
// *** illegal ***
struct outer0 {
template<typename inner_var>
struct inner { };
template<>
struct inner<void> { };
};
// ***
but is the following legal (compiles with g++, comeau, MSVC7.1) ?
// *** legal ***
struct outer0 {
template<typename inner_var, typename hack = void>
struct inner { };
template<typename hack>
struct inner<void,hack> { };
};
// ***
Example copied from:
http://lists.debian.org/debian-gcc/2004/09/msg00015.html
There I found as well:
In an explicit specialization declaration for a member of a class
template or a member template that appears in namespace scope, the
member template and some of its enclosing class templates may remain
unspecialized, except that the declaration shall not explicitly
specialize a class member template if its enclosing class templates
are not explicitly specialized as well.
but it does not tell if its legal .
Regards,
Patrick