#include <vector>
template < typename T >
void modify( T & t ) { }
int main() {
using namespace std;
vector<int> values; // construct once
while( ... ) {
// we have a new named variable 'v' but don't need construct
// vector<int> again, it share same memory with 'values'
vector<int> & v = values;
modify( values );
}
}
I2luY2x1ZGUgPHZlY3Rvcj4KIAp0ZW1wbGF0ZSA8IHR5cGVuYW1lIFQgPgp2b2lkIG1vZGlmeSggVCAmIHQgKSB7IH0KIAppbnQgbWFpbigpIHsKICAgIAogICAgdXNpbmcgbmFtZXNwYWNlIHN0ZDsKICAgIAogICAgdmVjdG9yPGludD4gdmFsdWVzOyAvLyBjb25zdHJ1Y3Qgb25jZQogICAgCiAgICB3aGlsZSggLi4uICkgewogICAgICAgIC8vIHdlIGhhdmUgYSBuZXcgbmFtZWQgdmFyaWFibGUgJ3YnIGJ1dCBkb24ndCBuZWVkIGNvbnN0cnVjdAogICAgICAgIC8vIHZlY3RvcjxpbnQ+IGFnYWluLCBpdCBzaGFyZSBzYW1lIG1lbW9yeSB3aXRoICd2YWx1ZXMnCiAgICAgICAgdmVjdG9yPGludD4gJiB2ID0gdmFsdWVzOwogICAgICAgIG1vZGlmeSggdmFsdWVzICk7CiAgICB9Cn0=