note: ‘person::person()’ is implicitly deleted because the default definition would be ill-formed

Well, the problem is not with that “note”. The “note” simply explains the reason for the error. The error is that you are trying to default-construct your person object when class person does not have a default constructor.

Instead of trying to default-construct it, you can {}– initialize that const member and the code will compile

person bob = { nextPersonID++, "Bob", {}, 1 };
bob.birthdate.day = 1;
bob.birthdate.month = 1;
bob.birthdate.year = 1990;
...

Alternatively, you can simply write your own default constructor for the class.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)