Advertencia C26496

La variable "variable" solo se asigna una vez; márquela como const.

Consulte también

con.4 de C++ Core Guidelines.

Ejemplo

int GetTheNumber();
int GiveMeTheNumber(int);

void function1()
{
    int theNumber = GetTheNumber(); // C26496, 'theNumber' is never assigned to again, so it can be marked as const
    std::cout << theNumber << '\n';

    GiveMeTheNumber(theNumber);
    // ...
}