Learn how a forward iterator can read and write, but can only increment. It cannot decrement; it's like a combination input/output iterator.
- [Instructor] The forward iterator is like a combination…of input and output iterators with a few other capabilities.…Here I have a working copy of forward iterator dot CPP…from chapter three of the exercise files.…The forward list is a single linked list type…and it's declared here in forward list header,…and it's designed to be efficient iterating…from beginning to end but not from end to beginning.…That's why it's a single linked list and uses…a forward iterator that can iterate forward…but it can not iterate back from end to beginning.…
In fact, we have a forward iterator here declared,…and if I were to say that IT one is equal to FL one dot end,…which would be the end of the list, and then try…to decrement the iterator when I build, you'll notice…that I get an error that I can not decrement the value…of a forward iterator, and that's because…the forward iterator hasn't even implemented…the decrement operator.…So, here we have a simple forward linked list,…and when I build and run, we have this for loop here.…
- Template fundamentals
- STL containers
- Accessing iterators
- Output, forward, and bidirectional iterators
- The transform function
- Transforming strings and types
- Arithmetic, relational, and logical functions
- STL algorithms
Skill Level Intermediate
2. STL Containers
3. STL Iterators
5. STL Functions
6. STL Algorithm
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.