New and Improved C++ Fundamentals

This chapter introduces new syntax and functionality in C++ that adds value to the language as a worthy successor to C++03. It discusses the features that promote the run‐time efficiency, reliability and usability of code, namely: Automatic memory management; move semantics; and new fundamental data...

Full description

Saved in:
Bibliographic Details
Published inFinancial Instrument Pricing Using C++ pp. 21 - 58
Main Author Duffy, Daniel J
Format Book Chapter
LanguageEnglish
Published United Kingdom John Wiley & Sons, Incorporated 2018
Wiley
Subjects
Online AccessGet full text
ISBN0470971193
9780470971192
DOI10.1002/9781119170518.ch2

Cover

More Information
Summary:This chapter introduces new syntax and functionality in C++ that adds value to the language as a worthy successor to C++03. It discusses the features that promote the run‐time efficiency, reliability and usability of code, namely: Automatic memory management; move semantics; and new fundamental data types. The chapter gives a short overview of object lifecycles. In particular, it considers the heap‐based memory allocation of objects. Such memory allocation and deallocation in C++ is the responsibility of the developer. The developers can allow automatic memory management by using garbage collection (GC) that is supported by some languages such as C# and Java. Another feature, that is move semantics, allows the compiler to replace expensive copying operations with less expensive move operations. In some cases, move semantics are the only options as some classes do not support copy constructors. Typical examples are smart pointers and classes for multithreading and multitasking.
ISBN:0470971193
9780470971192
DOI:10.1002/9781119170518.ch2