10.3.4
来源:互联网 发布:安卓6.0读取数据库 编辑:程序博客网 时间:2024/06/07 03:42
10.22
bool func(const string &s, string::size_type sz){ return s.size() <= sz;}std::cout << count_if(v.cbegin(), v.cend(), bind(func, _1, 6));
10.23
bind接受n+1个参数,n是arg_list 中参数的数目
10.24
auto check_size(string const& str, size_t sz){ return str.size() < sz;}auto result = find_if(vec.begin(), vec.end(), bind(check_size, str, _1));
10.25
#include <iostream>#include <vector>#include <string>#include <algorithm>#include <functional>using std::string; using std::vector;using namespace std::placeholders;void elimdups(vector<string> &vs){ std::sort(vs.begin(), vs.end()); vs.erase(unique(vs.begin(), vs.end()), vs.end());}bool check_size(const string &s, string::size_type sz){ return s.size() >= sz;}void biggies(vector<string> &words, vector<string>::size_type sz){ elimdups(words); auto iter = std::stable_partition(words.begin(), words.end(), bind(check_size, _1, sz)); for_each(words.begin(), iter, [](const string &s) { std::cout << s << " "; });}int main(){ std::vector<std::string> v{ "the", "quick", "red", "fox", "jumps", "over", "the", "slow", "red", "turtle" }; biggies(v, 4);}
0 0
- 10.3.4
- 10.3.4节练习
- 10.3
- [10.3]
- 10.3
- 10.3
- 10.3
- 10.3
- Weblogic 10.3 insallment and Cluster setup - 4
- 第十章 10.3.4节练习
- 算法导论习题:10.3-4 in JAVA
- C++ GUI Programming with Qt 4 - 10.3 实现自定义模型
- 算法导论 10.3-4 紧凑的多重数组
- Weblogic 10.3.6 在RHEL5.4 下安装(转载)
- (10.3.4)如何写出好的PRD
- C++Primer第五版 10.3.4节练习
- Weblogic 10.3.6 在RHEL5.4 下安装
- 10.3.4 direct path read and direct path read temp
- android stuido关于在V7包下找不到recyclerview的解决办法
- 2.3线性表的链式表示和实现
- python函数作用域以及LEGB原则
- 我的2017
- 匹配滤波器的物理解释
- 10.3.4
- Objective-C 内存管理
- 抽象工厂模式(13)
- 【NOIP2014模拟10.25A组】画矩形
- Unity中国象棋(一)——初始化棋子
- css精灵,滑动门
- Spark学习日记3
- 谷哥的小弟学前端(12)——JavaScript基础知识(3)
- 在结构体里设置字符串