Topic: template member explicit specialization, how?


Author: thimm@rige.physik.fu-berlin.de (Axel Thimm)
Date: 1998/06/25
Raw View
Hello,

suppose you have a template class with an inner template class:

template<class T> struct X {
  template<class V> struct Y {};
};

How would one define a specialized X::Y member for a specialized V?

Reading the (old draft) standard I cannot find a clear way to do so. If I try
to insert a

template<> struct Y<double> { int a; };

right after the primary definition I get an error form my compiler: "explicit
specialization is not allowed in the current scope".

It may be also that my compiler (KCC 3.2) lacks this point.

Thanks, Axel.
--
---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]