Pregunta

I've got a task pool using threads which is trying to call a boost::function that happens to be purely virtual, without an implementation.

Is there anything like this?

void doStuff(boost::function<void()> foo) 
{
    if (!foo.pure_virtual) 
    {
        foo();
    }
}

Note: This isn't the same as foo.empty or if (foo) { }. The .empty API doesn't seem to detect the pure virtual-ness of the method.

¿Fue útil?

Solución

You cannot detect it, and you shouldn't have it in there in the first place!

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top