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 4. Conversions

C++'s type system is appropriately complex for a language of its expressive power. This base complexity is complicated further by the presence of user-defined conversions that may be applied implicitly during translation. In effect, the ability to extend the C++ language through the addition of abstract data types gives the designer the responsibility of designing an effective, safe, and coherent type system. Because C++ is largely statically typed, it should be possible to tame this complexity with effective design.

Unfortunately, poor coding practices can compromise even the most coherent designs. In this chapter, we'll look at some common practices that defeat static type safety. We'll also look at some frequently ...

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