当前位置:网站首页>Callback uses lambda
Callback uses lambda
2022-07-27 06:06:00 【Mr FF】
// lambda_callable.cpp
#include <iostream>
using namespace std;
template <typename T, typename Func>
void ForEach(T* begin, T* end, const Func& func)
{
while (begin != end) {
func(*begin++);
}
}
int main(int argc, char **argv)
{
int array[] = {10, 11, 23, 25, 30};
ForEach(array, array + 5, [] (auto&x) {cout << x << " ";});
return 0;
}Compile implementation
g++ -o lambda_callable lambda_callable.cpp -std=c++14
10 11 23 25 30边栏推荐
- 基于C#的Winform对Access数据库进行操作(mdb结尾)
- 小技巧-彻底删除U盘中的文件
- 【头歌】重生之我在py入门实训中(7): 函数调用
- 李宏毅 2020 深度学习与人类语言处理 DLHLP-Coreference Resolution-p21
- 力扣160. 相交链表
- 【5·20特辑】MatLAb之我在和你表白
- Live Home 3D Pro室内家居设计工具
- 2022.6.10 STM32MP157串口时钟的学习
- [song] rebirth of me in py introductory training (12): Matplotlib interface and common graphics
- 这是我的博客
猜你喜欢

浅记一下十大排序
![[Haowen planting grass] knowledge of root domain name - Ruan Yifeng's Weblog](/img/75/8f41db9f9c077b43751d63b7b5b57e.png)
[Haowen planting grass] knowledge of root domain name - Ruan Yifeng's Weblog

Xmind 思维导图 2022 v12.0.3中文版更新了哪些内容?

A photo breaks through the face recognition system: you can nod your head and open your mouth, netizens

【Unity URP】代码获取当前URP配置UniversalRendererData,并动态添加RendererFeature

Speech and Language Processing (3rd ed. draft) Chapter 2 ——正则表达式,文本归一化,编辑距离 阅读笔记

Lightroom classic 2022 v11.4 Chinese version "latest resources"

安装windows下的redis

AE 3D粒子系统插件:Trapcode Particular

面试常问Future、FutureTask和CompletableFuture
随机推荐
韦东山 数码相框 项目学习(二)在LCD上显示中文字符
A photo breaks through the face recognition system: you can nod your head and open your mouth, netizens
17. Attenuation of momentum and learning rate
发布 分辨率0.22m的建筑物分割数据库
Unity Shader 概述
【12】理解电路:从电报机到门电路,我们如何做到“千里传信”?
What has been updated in the Chinese version of XMIND mind map 2022 v12.0.3?
力扣题解 二叉树(6)
System Design的相关准备材料
使用-Wall清除代码隐患
解决conda install 安装停止、中断问题
浅记一下十大排序
C语言-动态内存管理
Matlab 画图(超详细)
Can it replace PS's drawing software?
PZK学C语言之数据类型,进制转换,输入输出,运算符,分支语句ifelse
IOT operating system
19. Up and down sampling and batchnorm
SoK: The Faults in our ASRs: An Overview of Attacks against Automatic Speech Recognition (题目过长)阅读笔记
C语言-文件操作