0

I've written the following and expected a to be initilized with 4 rvalue. But it didn't:

struct A
{
    const int a;

    A() //ctor-initializer is not specified, therefore no initialization for a is performed
    {
        a = 4; //initialization
    }
};

A a;

What's wrong? Why does compiler complain?

user3663882
  • 6,957
  • 10
  • 51
  • 92

0 Answers0