[Bug c++/15359] errors specializing a template class of a template class
igodard at pacbell dot net
gcc-bugzilla@gcc.gnu.org
Tue May 11 18:07:00 GMT 2004
------- Additional Comments From igodard at pacbell dot net 2004-05-10 19:37 -------
But that doesn't work either (or rather it does, but it's not my case). My case is (using your suggested code):
template<typename E>
struct F {
template<typename G>
struct H {
};
H<E> h;
};
template<>
template<typename E>
struct F<E>::H<int> {
public:
int i;
};
int main() {
return 0;
}
That is, no matter what the template argument E to the outer template H is, I want the inner template H to specialize as specified when invoked with argument G as int. Note that the inner template does not depend in any way on either the outer template or its argiment. My reading of the standard says that this is legal (though I admit it is impossible to tell for the merely mortal), and gcc is not accepting it - nor any of the other constructions I've tried.
Is the above code actually legal? If not, is there a way to get the semantics I'm looking for? The obvious approach of simply making the specialization of H local to G (and so using whatever E is present) seems to be rejected, although for the life of me I can't guess why that would be so.
Ivan
--
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |UNCONFIRMED
Resolution|INVALID |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15359
More information about the Gcc-bugs
mailing list