I am trying to implement a template function with handles void differently using template specialization.
The following code gives me an \"Explicit specialization in non
It's not directly an answer to your question but you can write this
template
static T safeGuiCall(boost::function _f)
{
if (_f.empty())
throw GuiException("Function pointer empty");
{
ThreadGuard g;
return _f();
}
}
It should work even if _f() return 'void'
Edit : In a more general case, I think we should prefer function overloading instead of specialization. Here is a good explanation for this : http://www.gotw.ca/publications/mill17.htm