You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my project, when trying to check if an choc::threading::ThreadSafeFunctor<std::function<void()>> instance holds a value, I get this compiler error:
choc/threading/choc_ThreadSafeFunctor.h:142:12: error: no viable conversion from returned value of type 'std::function<void ()>' to function return type 'bool'
return callback->fn;
^~~~~~~~~~~~
The problem seems to be that std::function marks it conversion to bool as explicit. I can fix the problem by using an explicit conversion in choc:
In my project, when trying to check if an
choc::threading::ThreadSafeFunctor<std::function<void()>>
instance holds a value, I get this compiler error:The problem seems to be that
std::function
marks it conversion tobool
asexplicit
. I can fix the problem by using an explicit conversion in choc:I'm not sure this is the best fix, but it works for me.
Here's a test case that illustrates the use case:
I'm building with Clang from Xcode 15.4.
The text was updated successfully, but these errors were encountered: