M
mathieu
Hi there,
I don't think I'll be able to describe my issue correctly, so
instead I'll just give a pseudo C++ code I am struggling with.
Basically I am looking for a 'pure virtual template' function that I
would be able to declare in the base class (*).
Thanks for suggestions,
-Mathieu
(*)
struct Base
{
};
struct A : public Base
{
template <typename T> void foo() {}
};
struct B : public Base
{
template <typename T> void foo() {}
};
int main(int argc, char *argv[])
{
Base * base;
if( argc )
{
base = new A;
}
else
{
base = new B;
}
base->foo<int>();
return 0;
}
I don't think I'll be able to describe my issue correctly, so
instead I'll just give a pseudo C++ code I am struggling with.
Basically I am looking for a 'pure virtual template' function that I
would be able to declare in the base class (*).
Thanks for suggestions,
-Mathieu
(*)
struct Base
{
};
struct A : public Base
{
template <typename T> void foo() {}
};
struct B : public Base
{
template <typename T> void foo() {}
};
int main(int argc, char *argv[])
{
Base * base;
if( argc )
{
base = new A;
}
else
{
base = new B;
}
base->foo<int>();
return 0;
}