ormally, you initialize data members in a constructor's member initialization list. When a class has multiple constructors, each constructor initializes the object's members individually, which often leads to repeating the same initialization code in various places. The use of delegating constructors solves this problem to some extent, but there are cases in which you still need to repeat the initializers, thus risking maintenance difficulties and compromising code readability. This 10-Minute Solution presents a new technique for eliminating repeated initialization code.
Your class has multiple constructors, forcing you to repeat data member initialization code in every constructor.
Use class member initializers to initialize a data member only once.