Before Modern C++ approach (C++11) we initialized our class something like that.

But Modern C++ brings us this option.

Initializing by using simple curly brackets creates a method which runs before everything includes constructor methods, as a result, we don’t have to do anything for other alternative constructors.

1 thought on “Why nonstatic data initialization is important”

Leave a Reply

Your email address will not be published.