Closed Klaim closed 8 years ago
Pull request #4 seems to work for me, I mean your tests pass and mine too (when used in my code that was previously using std::function but now is using unique_function).
Fixed in 4456d92962e290445e2dfc7c66a074c5027ed454, thanks for your improvement.
std::function
have an explicit bool operator to allow it's user to evaluate if it contains something or not. Your function implementations does not, but it's necessary for code that stores optional callbacks and want to check if there is something to call before calling.Looking at the code, it seems to me that in storage_t, impl_t could be set to nullptr when there is nothing assigned. I'm trying this solution at the moment but I don't know if it's the best one yet.