STL的六大组件

一.分配器allocator

二.容器Containers

三.仿函数Functors

四.算法Algorithms

五.迭代器Iterator

六.适配器Adapters

一段程序同时包括六个组件

#include <vector>
#include<algorithm>
#include<functional>
#include<iostream>

int main() {
    vector<int, std::alloctor<int>> c {40, 11, 45, 23};
    cont << count_if(c.begin(), c.end(), notl(bind2nd(less<int>(), 40)));   return 0;
}

补充一个知识点:容器的区间是前闭后开的区间[ )

未经允许不得转载:木盒主机 » STL的六大组件

赞 (0)

相关推荐

    暂无内容!