You cannot detect it, and you shouldn't have it in there in the first place!
How to detect if a boost::function is pure virtual?
-
13-04-2022 - |
Вопрос
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.
Решение
Не связан с StackOverflow