// Code derived from Stroustrup's PPP2 book// § 8.5.5 Pass-by-reference// -and beginning on p 279#include<iostream>#include<vector>usingnamespacestd;voidinit(vector<double>&v)// pass-by-reference{for(inti=0;i<(int)v.size();++i)v[i]=i;}voidg(intx){vector<double>vd1(10);// small vectorvector<double>vd2(1'000'000);// large vectorvector<double>vd3(x);// vector of some unknown sizeinit(vd1);init(vd2);init(vd3);}intmain(){g(10);}