Alex H:

void test(const int n)
{
        auto j = n;
        j++;
}

Gives this error:
cannot modify const expression j


Is this considered a feature or a bug? I would assume most people wouldn't want new variables inheriting const.

It's a bit annoying. I don't remember people discussing this small problem. I don't know if it's easy to "fix" it and what side effects such change could cause.

Bye,
bearophile

Reply via email to