unique_ptr and lambdas
C++11 introduced by default several of the smart pointer types, e.g., unique pointers, shared pointers, etc. One of the features it was lacking was the ability to pass in a unique_ptr into a lambda expression. For example, the following wouldn’t work: This is because lambda’s capture list requires a copyable object to be passed in.…