Const variable in C++ function body

Viewed 1493

I believe I have it understod but I just want confirmation. If I have two functions,

function A()
{
    const Vector3D vectorA(1.0f);
    ...
}

function B(float var)
{
    const Vector3D vectorB(1.0f + var);
    ...
}

In the case of function A(), will vectorA only be constructed once in the program, no matter how many A() calls? I believe the compiler implicitly declares it static yes? But in the case of B(), vectorB needs to be reconstructed each function call?

4 Answers
Related