25
I have structure for storing callback function like this:
template<class T>
struct CommandGlobal : CommandBase
{
typedef boost::function<T ()> Command;
Command comm;
virtual T Execute() const
{
if(comm)
return comm();
return NULL;
}
};
Seems like it should work fine except when T is void because the Execute function wants to return a value..
What is the best solution to this problem?
Thanks!