《泛型编程与STL》读后感1--持续更新中

时间:2021-12-16 12:55:27 读后感 我要投稿

《泛型编程与STL》读后感1--持续更新中

《泛型编程与STL》学习感悟 1在C语言中有3种不同类型的指针:<1>普通而且有效的指针。比如&A[0];<2>非法指针,比如NULL<3>"past-the-end"指针,我们不能对其进行提领动作,但是可以用于指针运算。比如int A[10];我们不能用&A[10]. 2 虽然我们可以对于迭代器Iterator进行提领运算。但是这个并不能说明Iterator是一个指针。而仅仅是说明Iterator必须支持类似指针的接口。 3 operator++中。如果是operator++() 则说明是前++,如果是operator++(int ),则是后++、 4 Input Iterator并不能提供更改【iterator所指之物】的`方法、也就是说具有只读性。但是output iterator只具有只写性。并且用这两个迭代器的算法只能是“单回的”。任何时候任何区间只能有一个Input Iterator或者output iterator有效的迭代器。其他的迭代器具体的描述如下: Iterator Description input_iterator Read values with forward movement. These can be incremented, compared, and dereferenced. output_iterator Write values with forward movement. These can be incremented and dereferenced. forward_iterator Read or write values with forward movement. These combine the functionality of input and output iterators with the ability to store the iterators value. bidirectional_iterator Read and write values with forward and backward movement. These are like the forward iterators, but you can increment and decrement them. random_iterator Read and write values with random access. These are the most powerful iterators, combining the functionality of bidirectional iterators with the ability to do pointer arithmetic and pointer comparisons. reverse_iterator Either a random iterator or a bidirectional iterator that moves in reverse direction. Each of the container classes is associated with a type of iterator, and each of the STL algorithms uses a certain type of iterator. For example, vectors are associated with random-access iterators, which means that they can use algorithms that require random access. Since random-access iterators encompass all of the characteristics of the other iterators, vectors can use algorithms designed for other iterators as well.

【《泛型编程与STL》读后感1--持续更新中】相关文章:

传承话题作文(寒假作文系列)持续更新中02-11

HadoopNutch学习整理(持续更新) -电脑资料01-01

让编程教学摆脱枯燥-谈行为引导型教学方法在编程教学中的运用09-03

泛系论和社会:多层网络型泛系理法784e08-18

黔中罢职将泛江东,黔中罢职将泛江东李频,黔中罢职将泛江东的意思,黔中罢职将泛江东赏析 -诗词大全01-01

论可持续发展与环境法的更新01-20

对集约型持续农业提法的商榷07-19

10道关于Java泛型的面试题01-01

编写高质量代码改善C#程序——使用泛型集合代替非泛型集合(建议20) -电脑资料01-01