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.

You may also like...

1 Response

  1. 2020-03-16

    […] Use nonstatic data initialization instead of the old way. (Why nonstatic data initialization is important) […]

Leave a Reply

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