In article <bolg5e$tou$1@news4.tilbu1.nb.home.nl>,
mbmulder_remove_this_@home.nl says...[color=blue]
> Hi group,
>
> I have a problem with partial template specialization.[/color]
First and foremost that what you think is partial specialization is
really explicit specialization?
Partial specialization looks something like this:
template <class A, class B>
class X { ... };
template <class A>
class X<int, A> { ... };
The first is unspecialized -- either parameter can potentially be bound
to any type. The second is a partial specialization. We're specifying
what code will be produced when the first parameter happens to be int,
but the second parameter can still vary. The bottom line: to be partial
specialization, you have to have at least one each of specified
parameters and unspecified parameters. If you're specifying the types
of all parameters, you have an explicit specialization instead.
[color=blue]
> In the code
> below I have a template struct Music with one method, play(),
> and three kinds of music, Jazz, Funk and Bach. When I specialize
> Music<Bach>, I expect that the original play() method is available
> in the specialization, but it is not. How can I fix this?[/color]
No -- specialization is not inheritance. Each specialization (partial
or explicit) is independent of the primary template, and has to define
its own members. The members of a specialization may be completely
different from the members of the primary template.
--
Later,
Jerry.
The universe is a figment of its own imagination.