c++ lambda表达式相关代码的疑惑?

#include <iostream>
using namespace std;
#include <functional>
#include <memory>

class Value
{
public:
    Value() { cout << "Value()" << endl; }
    Value(const Value &v) {
        this->a = v.a;
        cout << "Value(const Value &v)" << endl;
    }
    ~Value() { cout << "~Value()" << endl; }
    Value &operator=(const Value &v) {
        this->a = v.a;
        cout << "Value& operator=(const Value &v)" << endl;
        return *this;
    }
    int a;
};
std::function<void()> func;
void test1()
{
    Value v;
    v.a = 10;
    auto func1 = [v]() {
        cout << "a:" << v.a << endl;
    };
    func1();
}
void test2()
{
    Value v;
    v.a = 20;
    func = [v]() {
        cout << "a:" << v.a << endl;
    };
}

int main()
{
    test1();
    cout << "####################" << endl;
    test2();
        cout << "####################" << endl;
    func();

    system("pause");
}

输出的结果是:
Value()
Value(const Value &v)
a:10
~Value()
~Value()
####################
Value()
Value(const Value &v)
Value(const Value &v)
Value(const Value &v)
~Value()
~Value()
~Value()
####################
a:20

  1. 为什么test1()里只调用了一次拷贝构造函数,而test2() 函数里 Value的拷贝构造函数调用了3次?
  2. 为什么test2()里有4个构造函数而析构函数只调用了3次?

std::function 拷贝了一次

https://blog.csdn.net/qq_36038987/article/details/80833277