Double free in the C++ standard library using only std::function and std::shared_pointer
I believe the relevant part of the standard is [res.on.objects], which states If an object of a standard library type is accessed, and the beginning of the object’s lifetime does not happen before the access, or the access does not happen before the end of the object’s lifetime, the behavior is undefined unless otherwise specified. … Read more