
    #include <iostream>
    #include <list>
    #include <functional>
    using namespace std;
    
    int main() {
    	int a = 2, b = 6, c = 1;
    	
    	list<reference_wrapper<int>> mylist;
    	mylist.push_back(a);
    	mylist.push_back(b);
    	mylist.push_back(c);
    	
    	for(auto x : mylist) {
    		cout << x << " ";
    	}
    	cout << endl;
    	a = 3; // <- this setting will modify mylist!
    
    	for(auto x : mylist) {
    		cout << x << " ";
    	}
    	return 0;
    }
