Hey!
I'd like to create a template interface for data-handling classes in my projects.
I can write something like this:
template <class T>
class DataHandler
{
public:
void Process(const& T) = 0;
};
Then, suppose, I define a class this way:
class MyClass: public DataHandler<int>
{
void Process(const int&) { /* Bla-bla */ }
}
Now, come the question, can I somehow define my template interface in the way that as parameter it will recieve not just type T, but the whole signature of the Process() function.
I would like something working this way:
class MyClass: public DataHandler<void (int&)>
{
void Process(const int&) { /* Bla-bla */ }
}
Is it possible? I know that, for instance, boost::signal receives template parameters this way, but, if I understand correctly, they use lot of black-magic there.