T
Thomas Maier-Komor
Hi everybody,
I am a little bit confused with the syntax of explicit instantiation,
and I am not sure that it is possible to do what I want to do.
Maybe someone has an idea.
Consider a template class:
template <class ABC>
struct CT : public ABC
{
template<typename T>
void a(T const &)
{
// something
}
// the next line is not enough for what I want, but probably needed
using ABC::a;
};
//... and an abstract base class:
struct ABC
{
virtual void a(int const &) = 0;
};
//... and a usage:
struct MyClass : public CT<ABC>
{
};
now CT<>::a hides ABC::a. But I would like to instantiate CT::a
so that it does not hide ABC::a, but implement the virtual
function ABC::a for MyClass.
Is this possible? what do I have to write into MyClass?
Any idea?
Tom
I am a little bit confused with the syntax of explicit instantiation,
and I am not sure that it is possible to do what I want to do.
Maybe someone has an idea.
Consider a template class:
template <class ABC>
struct CT : public ABC
{
template<typename T>
void a(T const &)
{
// something
}
// the next line is not enough for what I want, but probably needed
using ABC::a;
};
//... and an abstract base class:
struct ABC
{
virtual void a(int const &) = 0;
};
//... and a usage:
struct MyClass : public CT<ABC>
{
};
now CT<>::a hides ABC::a. But I would like to instantiate CT::a
so that it does not hide ABC::a, but implement the virtual
function ABC::a for MyClass.
Is this possible? what do I have to write into MyClass?
Any idea?
Tom