Consider: ``` void TestAndRun(folly::Function<void()> f) { if (f) f(); } ``` The following usage works perfectly: ``` TestAndRun([]{}); TestAndRun({}); TestAndRun(nullptr); ``` The following gets past the `if` check and results in "bad_function_call" exception thrown by `std::function`: ``` TestAndRun(std::function<void()>()); ``` Also, it seems the behavior varies with build/optimization settings - sometimes things work.
Activity
Generic detection of empty-callable in Function ctor