Sequence container ---- forward_list

Stored as a single list element. forward_list templates defined in the header file forward_list in. fdrward_list and list the main difference is: it can not be reversed through the elements; can only be traversed from start to finish.

forward_list one-way link also means that it will have some other features:

  • Unable to use a reverse iterator. Only, which iterator can not get it from the front dereference or non-const const iterators, only self-energizing;
  • No member function can return back the last element reference (); only member function front ();
  • Because only through the front element of the self-energizing iterator to reach the end of the sequence, so the push_back (), pop_back (), emplace_back () can not be used.

 

Guess you like

Origin www.cnblogs.com/pacino12134/p/11442276.html