Lazy initialization is one of those design patterns which is in use in almost all programming languages. Its goal is to move the object’s construction forward in time. It’s especially handy when the creation of the object is expensive, and you want to defer it as late as possible, or even skip entirely.
Keep reading and see how you can use this pattern with the C++ Standard Library.
Read more...