- Modern C++ Programming Cookbook
- Marius Bancila
- 186字
- 2021-06-11 18:22:18
3 Exploring Functions
Functions are a fundamental concept in programming; regardless of the topic we discuss, we end up writing functions. Trying to cover functions in a single chapter is not only hard but also not very rational. Being a fundamental element of the language, functions are encountered in every recipe of this book. This chapter, however, covers modern language features related to functions and callable objects, with a focus on lambda expressions, concepts from functional languages such as higher-order functions, and type-safe functions with a variable number of arguments.
The recipes included in this chapter are as follows:
- Defaulted and deleted functions
- Using lambdas with standard algorithms
- Using generic and template lambdas
- Writing a recursive lambda
- Writing a function template with a variable number of arguments
- Using fold expressions to simplify variadic function templates
- Implementing the higher-order functions map and fold
- Composing functions into a higher-order function
- Uniformly invoking anything callable
We will start this chapter by learning about a feature that makes it easier for us to provide special class member functions or prevent any function (member or non-member) from being invoked.
- 新編Visual Basic程序設計上機實驗教程
- C#編程入門指南(上下冊)
- 算法精粹:經典計算機科學問題的Java實現
- ASP.NET Core 2 and Vue.js
- 實戰Java程序設計
- Scratch 3.0少兒編程與邏輯思維訓練
- Koa開發:入門、進階與實戰
- Groovy for Domain:specific Languages(Second Edition)
- Learn WebAssembly
- 人人都是網站分析師:從分析師的視角理解網站和解讀數據
- 零基礎學Python數據分析(升級版)
- 移動界面(Web/App)Photoshop UI設計十全大補
- Python預測之美:數據分析與算法實戰(雙色)
- C#程序開發參考手冊
- Jenkins 2.x Continuous Integration Cookbook(Third Edition)