Get up to date quickly on the new changes coming with C++17 Professional C++ is the advanced manual for C++ programming. Designed to help experienced developers get more out of the latest release, this book skims over the basics and dives right in to exploiting the full capabilities of C++17. Each feature is explained by example, each including actual code snippets that you can plug into your own applications. Case studies include extensive, working code that has been tested on Windows and Linux, and the author's expert tips, tricks, and workarounds can dramatically enhance your workflow. Even many experienced developers have never fully explored the boundaries of the language's capabilities; this book reveals the advanced features you never knew about, and drills down to show you how to turn these features into real-world solutions. The C++17 release includes changes that impact the way you work with C++; this new fourth edition covers them all, including nested namespaces, structured bindings, string_view, template argument deduction for constructors, parallel algorithms, generalized sum algorithms, Boyer-Moore string searching, string conversion primitives, a filesystem API, clamping values, optional values, the variant type, the any type, and more. Clear explanations and professional-level depth make this book an invaluable resource for any professional needing to get up to date quickly. Maximize C++ capabilities with effective design solutions Master little-known elements and learn what to avoid Adopt new workarounds and testing/debugging best practices Utilize real-world program segments in your own applications C++ is notoriously complex, and whether you use it for gaming or business, maximizing its functionality means keeping up to date with the latest changes. Whether these changes enhance your work or make it harder depends on how well-versed you are in the newest C++ features. Professional C++ gets you up to date quickly, and provides the answers you need for everyday solutions. Intro TITLE PAGE TABLE OF CONTENTS INTRODUCTION WHO THIS BOOK IS FOR WHAT THIS BOOK COVERS HOW THIS BOOK IS STRUCTURED WHAT YOU NEED TO USE THIS BOOK CONVENTIONS SOURCE CODE ERRATA NOTES PART I: Introduction to Professional C++ 1 A Crash Course in C++ and the Standard Library THE BASICS OF C++ DIVING DEEPER INTO C++ C++ AS AN OBJECT-ORIENTED LANGUAGE UNIFORM INITIALIZATION THE STANDARD LIBRARY YOUR FIRST USEFUL C++ PROGRAM SUMMARY NOTE 2 Working with Strings and String Views DYNAMIC STRINGS SUMMARY 3 Coding with Style THE IMPORTANCE OF LOOKING GOOD. DOCUMENTING YOUR CODEDECOMPOSITION NAMING USING LANGUAGE FEATURES WITH STYLE FORMATTING STYLISTIC CHALLENGES SUMMARY PART II: Professional C++ Software Design 4 Designing Professional C++â#x80 #x89 Programs WHAT IS PROGRAMMING DESIGN? THE IMPORTANCE OF PROGRAMMING DESIGN DESIGNING FOR C++ TWO RULES FOR C++ DESIGN REUSING EXISTING CODE DESIGNING A CHESS PROGRAM SUMMARY 5 Designing with Objects AM I THINKING PROCEDURALLY? THE OBJECT-ORIENTED PHILOSOPHY LIVING IN A WORLD OF OBJECTS OBJECT RELATIONSHIPS ABSTRACTION SUMMARY 6 Designing for Reuse THE REUSE PHILOSOPHY. HOW TO DESIGN REUSABLE CODESUMMARY PART III: C++ Coding the Professional Way 7 Memory Management WORKING WITH DYNAMIC MEMORY ARRAY-POINTER DUALITY LOW-LEVEL MEMORY OPERATIONS SMART POINTERS COMMON MEMORY PITFALLS SUMMARY NOTE 8 Gaining Proficiency with Classesâ#x80 ānd Objects INTRODUCING THE SPREADSHEET EXAMPLE WRITING CLASSES OBJECT LIFE CYCLES SUMMARY 9 Mastering Classes and Objects FRIENDS DYNAMIC MEMORY ALLOCATION IN OBJECTS MORE ABOUT METHODS DIFFERENT KINDS OF DATA MEMBERS NESTED CLASSES ENUMERATED TYPES INSIDE CLASSES OPERATOR OVERLOADING BUILDING STABLE INTERFACES. STRING STREAMSFILE STREAMS BIDIRECTIONAL I/O SUMMARY 14 Handling Errors ERRORS AND EXCEPTIONS EXCEPTION MECHANICS EXCEPTIONS AND POLYMORPHISM RETHROWING EXCEPTIONS STACK UNWINDING AND CLEANUP COMMON ERROR-HANDLING ISSUES PUTTING IT ALL TOGETHER SUMMARY NOTES 15 Overloading C++ Operators OVERVIEW OF OPERATOR OVERLOADING OVERLOADING THE ARITHMETIC OPERATORS OVERLOADING THE BITWISE AND BINARY LOGICAL OPERATORS OVERLOADING THE INSERTION AND EXTRACTION OPERATORS OVERLOADING THE SUBSCRIPTING OPERATOR OVERLOADING THE FUNCTION CALL OPERATOR OVERLOADING THE DEREFERENCING OPERATORS. Annotation Get up to date quickly on the big changes coming with C++17 Professional C++ is the advanced manual for C++ programming. Designed to help experienced developers get more out of the latest release, this book skims over the basics and dives right in to exploiting the full capabilities of C++17. Each feature is explained by example, each including actual code snippets that you can plug into your own applications. Case studies include extensive, working code that has been tested on Windows, Linux, and Solaris, and the author's expert tips, tricks, and workarounds can dramatically enhance your workflow. Even many experienced developers have never fully explored the boundaries of the language's capabilities; this book reveals the advanced features you never knew about, and drills down to show you how to turn these features into real-world solutions. The C++17 release includes changes that impact the way you work with C++; this new fourth edition covers them all, including nested namespaces, structured bindings, string_view, template argument deduction for constructors, math functions, parallel algorithms, generalized sum algorithms, Boyer-Moore string searching, string conversion primitives, a filesystem API, clamping values, optional values, the variant type, the any type, and more. Clear explanations and professional-level depth make this book an invaluable resource for any professional needing to get up to date quickly. Maximize C++ capabilities with effective design solutions Master little-known elements and learn what to avoid Adopt new workarounds and testing/debugging best practices Utilize real-world program segments in your own applications C++ is notoriously complex, and whether you use it for gaming or business, maximizing its functionality means keeping up to date with the latest changes. This time, those changes are extensive?and whether they enhance your work or make it harder depends on how well-versed you are in the newest C++ features. Professional C++ gets you up to date quickly, and provides the answers you need for everyday solutions Embrace C++ depth and complexity to discover just how much it can doC++ is notoriously difficult to master, but its wide-ranging capabilities have made it the most common language for gaming and commercial software applications. Even experienced users are typically unfamiliar with many advanced features, but the release of C++17 presents the perfect opportunity to explore the language's full capabilities. This new fourth edition of Professional C++ provides a code-intensive, solutions-oriented guide to everything C++ has to offer, including the newest tools and features in the latest release. Packed with practical instructions geared toward real-world programming, this book is the programmer's ideal opportunity to dig deeper into C++.Professional C++:* Demonstrates how to think in C++ in order to maximize the language's far-reaching capabilities and develop effective solutions* Explains poorly understood elements, warns against pitfalls, and shares tips, tricks, and workarounds for efficiency and performance* Presents a variety of challenging, real-world program segments versatile enough to plug into any project* Highlights the new features of C++17 including structured bindings, nested namespaces, constexpr if, and much more* Features in-depth discussions of new C++17 Standard Library features, such as string_view, optional, parallel algorithms, the file system API, and moreWrox Professional guides are written by working programmers to meet the real-world needs of programmers, developers, and IT professionals. Focused and relevant, they address the issues technology professionals face every day. They provide examples, practical solutions, and expert education in new technologies, all designed to help programmers do a better job 10 Discovering Inheritance Techniques; BUILDING CLASSES WITH INHERITANCE; INHERITANCE FOR REUSE; RESPECT YOUR PARENTS; INHERITANCE FOR POLYMORPHISM; MULTIPLE INHERITANCE; INTERESTING AND OBSCURE INHERITANCE ISSUES; SUMMARY; 11 C++ Quirks, Oddities, and Incidentals; REFERENCES; KEYWORD CONFUSION; TYPES AND CASTS; SCOPE RESOLUTION; ATTRIBUTES; USER-DEFINED LITERALS; HEADER FILES; C UTILITIES; SUMMARY; NOTES; 12 Writing Generic Code with Templates; OVERVIEW OF TEMPLATES; CLASS TEMPLATES; FUNCTION TEMPLATES; VARIABLE TEMPLATES; SUMMARY; 13 Demystifying C++ I/O; USING STREAMS