Type Traits, Advanced Lambdas and Multiparadigm Design in C++ - Duffy, Daniel J (Financial Instrument Pricing Using C++, 2018)
This chapter introduces several advanced language features in C++ that can be used when creating generic libraries, generic lambda functions and when moving to multiparadigm design methods. First, it discusses the C++ type traits library and also discusses the different type traits categories and provides some examples. Having discussed the functionality in the type traits library, the chapter examines what this functionality is good for and how it can be used to improve code quality in general. Then, it gives a short discussion on applications of generic lambdas and provides motivating examples. To show the power of generic lambdas, the chapter introduces a branch of topology called homotopy theory and homotopic mappings. Furthermore, it applies modern C++ syntax to design a small framework to model stochastic differential equations. Finally, the chapter shows how to define higher‐order functions that can be used in numerical analysis and computational finance.