Closed Rajveer86 closed 5 years ago
This is probably a duplicate of #23 which was fixed in e3695b4b4. Could you test whether there are still issues when using the current HEAD e3695b4b4fa3c672e of the master branch?
Thanks for the quick reply, I'll test this out tonight and will let you know!
@Naios Sorry I didn't see the other issue, I've confirmed that the current HEAD fixes this. Thank you :)
@Naios
Commit Hash
d2acdb6 (release 4.0.0)
Expected Behavior
When using fu2::function_base to create a custom unique_function with IsThrowing set to false, storing the custom unique_function in a std::vector should not invoke abort() on vector resize (due to the vector trying to call the copy constructor):
Actual Behavior
abort()
is called when the vector tries to copy it's contents internally.Steps to Reproduce
The following code calls
abort()
onfunctions.reserve(...)
:I have read that std::vector will only internally move the object on memory reallocation if the type's move constructor and assignment operator are marked as
noexcept
, therefore I tried changing the vector tostd::vector<UniqueFunction<void() noexcept>>
and addingnoexcept
to the lambda with no effect.Changing IsThrowing to
true
corrects everything. Please let me know if I'm misunderstanding anything!Your Environment