Why nonstatic data initialization is important

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.

One thought on “Why nonstatic data initialization is important”

Leave a Reply

Your email address will not be published. Required fields are marked *