当前位置:网站首页>回调使用lambda
回调使用lambda
2022-07-27 05:19: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;
}编译执行
g++ -o lambda_callable lambda_callable.cpp -std=c++14
10 11 23 25 30边栏推荐
- pytorch中交叉熵损失函数的细节
- Speech and Language Processing (3rd ed. draft) Chapter 2 ——正则表达式,文本归一化,编辑距离 阅读笔记
- 数字图像处理 第二章 数字图像基础
- 视觉横向课题bug1:FileNotFoundError: Could not find module ‘MvCameraControl.dll‘ (or one of it
- 古老的艺术-用好长尾关键词
- 谈谈为何需要将类的成员函数声明为private
- Gbase 8C - SQL reference 6 SQL syntax (6)
- Gbase 8C - SQL reference 6 SQL syntax (3)
- Day 17.The role of news sentiment in oil futures returns and volatility forecasting
- 10. Gradient, activation function and loss
猜你喜欢
![[concurrent programming series 9] priorityblockingqueue, delayqueue principle analysis of blocking queue](/img/2b/1bfadbffad33f8560357fab74e8308.png)
[concurrent programming series 9] priorityblockingqueue, delayqueue principle analysis of blocking queue

Day 7. Towards Preemptive Detection of Depression and Anxiety in Twitter

西瓜书第三章---线性模型学习笔记

10. Gradient, activation function and loss

Chrome 如何快速将一组正在浏览的网页(tabs)转移到另一台设备(电脑)上

关于pytorch反向传播的思考

李宏毅 2020 深度学习与人类语言处理 DLHLP-Conditional Generation by RNN and Attention-p22

Inno setup package jar + H5 + MySQL + redis into exe

1. Introduction to pytorch

leetcode系列(一):买卖股票
随机推荐
模型的推理速度
Gbase 8C - SQL reference 6 SQL syntax (4)
Day10. Work organization and mental health problems in PhD students
9.高阶操作
Day 4.Social Data Sentiment Analysis: Detection of Adolescent Depression Signals
Day 3. Suicidal ideation and behavior in institutions of higher learning: A latent class analysis
Gbase 8C - SQL reference 6 SQL syntax (3)
Gbase 8C - SQL reference 6 SQL syntax (2)
Performance optimization of common ADB commands
RK3288板卡HDMI显示uboot和kernel的logo图片
8.数学运算与属性统计
12.优化问题实战
数字图像处理——第三章 灰度变换与空间滤波
【头歌】重生之深度学习篇-Keras(初级)
Inno setup package jar + H5 + MySQL + redis into exe
数字图像处理 第八章——图像压缩
[MVC Architecture] MVC model
【头歌】重生之CNN图片分类基础
15.GPU加速、minist测试实战和visdom可视化
Uboot中支持lcd和hdmi显示不同的logo图片