O'Reilly logo

C++ Gotchas: Avoiding Common Problems in Coding and Design by Stephen C. Dewhurst

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 5. Initialization

The semantics of initialization in C++ are subtle, complex, and important.

The reasons behind this complexity are not frivolous. Much of programming in C++ consists of using classes to design abstract data types. Essentially, we extend the base C++ language with new data types integrated into the rest of the type system. On one hand, we’re engaged in programming-language design to produce usable, integrated types. On the other hand, we’re engaged in translator design, in that we must convince the compiler to translate our implementations of these abstract data types efficiently. The details of initialization and copying of class objects are essential to efficient, production-quality use of data abstraction.

Equally ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required