std::vector C(4);
for(int i = 0; i < 1000;++i)
for(int j = 0; j < 2000; ++j)
{
C[0] = 1.0;
C[1] = 1.0;
C[2] = 1.0;
C[3] = 1.
The scope of the obj would be inside the loop, so you won't be able to use it once the loop(s) is(are) finished. This is in addition, to the object getting instantiated and then destroyed as many times as the loop(s) goes(go) through. In the end, nothing is accomplished except time is being wasted constructing and then destroying the object.