When I declare some variables inside a function and then call that function inside a loop, are the variables destroyed and reconstructed at each step? Is that bad and can/should be avoided? Here an example of what I'm doing:
void myfun(vector<double> &x){
vector<double>y;
y.resize(x.size());
//computation
}
int main(){
vector<double>x(3,0);
for(int i=0;i<5000;i++)
myfun(x);
}