(原創) 为什么说iterator是left inclusive? (C/C++) (STL)
2006-11-15 23:20
387 查看
因为c.begin()是第一个element,但c.end()并不是最后一个element,而是one past the end,所以c.end()并不是iterator.
若以符号表示,则是
[first,last)
the range begin with first and ends with, but not include, last.
Reference
C++ Primer 4th P.314
若以符号表示,则是
[first,last)
the range begin with first and ends with, but not include, last.
Reference
C++ Primer 4th P.314
相关文章推荐
- (原創) iterator到底是不是pointer? (C/C++) (STL)
- C++STL为什么要有const_iterator
- STL为什么要提供_Int_iterator_tag
- STL中的iterator形参为什么不是传引用而是传值
- (原創) 如何將container中的iterator,從一個值取代成另外一個值? (C/C++) (STL)
- (原創) 如何使用reverse_iterator? (C/C++) (STL)
- (原創) 如何使for_each()傳回值? (C/C++) (STL)
- 谈vector<bool>的特殊性——为什么它不是STL容器
- java为什么不直接实现Iterator接口,而是实现Iterable
- STL之insert_iterator
- 【C++ STL学习之八】逆向迭代器reverse_iterator
- 为什么auto_ptr智能指针不能作为STL标准容器的元素
- 【STL】迭代器以及“特性萃取机”iterator_traits
- STL中istream_iterator和ostream_iterator的基本用法
- 如何使用reverse_iterator? (C/C++) (STL)
- STL iterator和traits编程技法
- STL与泛型编程<十>:迭代器适配器(Iterator Adapters)之逆向迭代器
- STL(十):迭代器适配器{(插入迭代器back_insert_iterator)、IO流迭代器(istream_iterator、ostream_iterator)}
- 【STL】迭代器iterator和有关问题
- STL--迭代器(iterator)使用详解