This chapter is from the book
12.4forward_list
The standard library also offers a singly-linked list calledforward_list:
forward_list: Aforward_listdiffers from a (doubly-linked)list通过只允许向前迭代。t的点hat is to save space. There is no need to keep a predecessor pointer in each link and the size of an emptyforward_listis just one pointer. Aforward_listdoesn’t even keep its number of elements. If you need the number of elements, count. If you can’t afford to count, you probably shouldn’t use aforward_list.