11-01-02-3.cpp
来自「more efftive 代码」· C++ 代码 · 共 20 行
CPP
20 行
#include <cassert>#include <list>#include <algorithm>#include <functional>using namespace std;int main(){ list<int> L; L.push_back(-3); L.push_back(0); L.push_back(3); L.push_back(-2); L.push_back(7); list<int>::iterator result = find_if(L.begin(), L.end(), bind2nd(greater<int>(), 0)); assert(result == L.end() || *result > 0);}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?