This forum can be used to talk about general design strategies, new ideas and questions in general related to wxWidgets. If you feel your questions doesn't fit anywhere, put it here.
#include <iostream>
class Speaker
{
public:
void SayHello(){ std::cout << "Hello world" << std::endl;
};
class Some
{
public:
template<class A>
Some()
{
A*a = new A();
a->SayHello();
}
};
int main()
{
Some *s = new ???// what code I must put here, if I want initialize some with Speaker class
}
May be C++ standart forbid constructions like this?
I know, that this is a simple solution, but I don`t need "solution", i need answer to my question . I know another few solutions how to avoid this problem. I got just theoretical interest , not practical.
Note: because the explicit template argument list follows the function template name, and
because conversion member function templates and constructor member function templates are called without
using a function name, there is no way to provide an explicit template argument list for these function templates