On Wednesday, 24 July 2013 at 08:07:55 UTC, Alex H wrote:
This code:

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.

There is no error. All right.

auto - the type expects the maximum transfer of properties from the context.
int j = n; j++ // if change j

Reply via email to