tuple在构造时,会通过拷贝构造或移动构造对对象进行复制或移动:
#include <iostream>
#include <tuple>
using namespace std;
class A{
public:
A(int i): m_i(i)
{
cout<<"construct A, "<<"m_i="<<m_i<<", addr of this:"<<this<<", addr of this m_i:"<<&m_i<<endl;
}
A(const A& a)
{
this->m_i = a.m_i;
cout<<"copy construct A, "<<"m_i="<<m_i<<", addr of this:"<<this<<", addr of this m_i:"<<&m_i<<", ori addr:"<<&a<<endl;
}
A(A&& a)
{
this->m_i = a.m_i;
cout<<"move construct A, "<<"m_i="<&l