#include<iostream>
#include<vector>
using std::vector;
struct Node{
int value;
int key;
// struct初始化
Node(int _v,int _k):value(_v),key(_k){}
};
int main(int argc, char *argv[])
{
vector<Node> vec;
vec.push_back(Node(1,1));
vec.push_back(Node(2,2));
vec.push_back(Node(3,3));
// 这里的i是只读的,写入auto &i
for(auto i:vec){
i.value = 1;
}
for(auto i:vec){
std::cout<<i.value<<std::endl;
}
return 0;
}