1 Star 0 Fork 0

green-gitee/博客园

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
archery.h 1.05 KB
一键复制 编辑 原始数据 按行查看 历史
green-gitee 提交于 4年前 . Added resources.
/*
* archery.h
*
* Callables for testing Thread_Pool.
*
*/
#ifndef ARCHERY_H
#define ARCHERY_H
#include <cstdio>
void shoot() {
std::fprintf(stdout, "\n\t[Free Function] Let an arrow fly...\n");
}
bool shoot(size_t n) {
std::fprintf(stdout, "\n\t[Free Function] Let %zu arrows fly...\n", n);
return false;
}
auto shootAnarrow = [] {
std::fprintf(stdout, "\n\t[Lambda] Let an arrow fly...\n");
};
auto shootNarrows = [](size_t n) -> bool {
std::fprintf(stdout, "\n\t[Lambda] Let %zu arrows fly...\n", n);
return true;
};
class Archer {
public:
void operator()() {
std::fprintf(stdout, "\n\t[Functor] Let an arrow fly...\n");
}
bool operator()(size_t n) {
std::fprintf(stdout, "\n\t[Functor] Let %zu arrows fly...\n", n);
return false;
}
void shoot() {
std::fprintf(stdout, "\n\t[Member Function] Let an arrow fly...\n");
}
bool shoot(size_t n) {
std::fprintf(stdout, "\n\t[Member Function] Let %zu arrows fly...\n", n);
return true;
}
};
#endif
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/green-gitee/cnblogs.git
git@gitee.com:green-gitee/cnblogs.git
green-gitee
cnblogs
博客园
master

搜索帮助