In this post, we will see how to resolve Double free in the C++ standard library using only std::function and std::shared_pointer Question: I recently came across a weird double-free bug in a program when capturing a shared_ptr in a lambda. ...