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

时间:2023-04-25 09:51:01 读后感 我要投稿
  • 相关推荐

《泛型编程与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--持续更新中】相关文章:

2006高考英语真题发布(更新中)05-04

编程的心得03-14

和尹从事懋泛洞庭,和尹从事懋泛洞庭张说,和尹从事懋泛洞庭的意思,和尹从事懋泛洞庭赏析 -诗词大全03-13

数控编程心得05-07

临泛东湖(时任洪州),临泛东湖(时任洪州)张九龄,临泛东湖(时任洪州)的意思,临泛东湖(时任洪州)赏析 -诗词大全03-13

东湖临泛饯王司马,东湖临泛饯王司马张九龄,东湖临泛饯王司马的意思,东湖临泛饯王司马赏析 -诗词大全03-13

《步步惊心》读后感之1--十四阿哥04-27

有趣的编程课作文04-20

泛吴松江阅读答案翻译赏析12-20

女友道歉信更新01-22