fix typo in code example in C.43 (#2040)

This commit is contained in:
Xeverous 2023-02-17 17:31:31 +01:00 committed by GitHub
parent e1a453b0b0
commit e80373f226
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5603,7 +5603,7 @@ A default constructor often simplifies the task of defining a suitable [moved-fr
};
vector<Date> vd1(1000); // default Date needed here
vector<Date> vd2(1000, Date{Month::October, 7, 1885}); // alternative
vector<Date> vd2(1000, Date{7, Month::October, 1885}); // alternative
The default constructor is only auto-generated if there is no user-declared constructor, hence it's impossible to initialize the vector `vd1` in the example above.
The absence of a default value can cause surprises for users and complicate its use, so if one can be reasonably defined, it should be.