Effective STL 18 avoid using vector<bool>
2017-08-27 16:38
417 查看
vector dosen’t satisfy the requirements of an STL constainer, you are best off not using it; and deque and biset are alternative data structures that will almost certainly satisfy your need for the capabilies promised by vector.
template <typename Allocator> vector<bool, Allocator> { public: class reference {...}; reference operator[](size_type n); ... }; vector<bool> v; bool *pb = &v[0]; // error! the expression on the right is of type // vector<bool>::reference*, not bool*
相关文章推荐
- effective stl 条款18:避免使用vector<bool>
- 条款18:避免使用vector<bool>
- 条款18:避免使用vector<bool>
- effective stl 第18条: 避免使用vector<bool>
- Effective STL 学习笔记 Item 18: 慎用 vector<bool>
- 条款18:避免使用vector<bool>(转)
- C++ 练习记录2---Effective STL中的vector<bool>
- STL容器之vector<bool>
- STL vector<bool>的介绍(1)
- 说一说vector<bool>
- C++ std::vector<bool>
- std::vector<bool>
- 说一说vector<bool>
- STL vector<bool>中的reference(2)
- 不使用vector<bool>的原因和替代方法
- 想知道vector<bool>有多坑人吗
- vector<bool>STL中的陷阱
- 避免使用vector<bool>
- 谈vector<bool>的特殊性——为什么它不是STL容器
- vector<bool>效率问题的原因和替代方法