我很难实现这样的事情:
int a = 5; int& b = a; pair <int, int> test; test.first = b; a = 1000;
test.first显然,值不会改变,但是我希望它能够改变,所以我试图创建pair <int&, int&>,但我不能因为编译器.
test.first
pair <int&, int&>
我的目标是test.first改变,我该如何实现它(不使用int*指针,是)?
int*
c++ stl
c++ ×1
stl ×1