- 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.
- HTML5+CSS3+JavaScript從入門到精通:上冊(微課精編版·第2版)
- Google Apps Script for Beginners
- Spring 5企業級開發實戰
- Mastering JavaScript Object-Oriented Programming
- Learning Bayesian Models with R
- 精通Scrapy網絡爬蟲
- Visual Basic程序設計與應用實踐教程
- Eclipse Plug-in Development:Beginner's Guide(Second Edition)
- Scala謎題
- 精通MySQL 8(視頻教學版)
- .NET 4.5 Parallel Extensions Cookbook
- Swift語言實戰晉級
- 自學Python:編程基礎、科學計算及數據分析(第2版)
- SignalR:Real-time Application Development(Second Edition)
- JavaScript編程精解(原書第2版)