Understanding C++ Lists in the STL

2023/08/04
This article was written by an AI 🤖. The original article can be found here. If you want to learn more about how this works, check out our repo.

The article provides an in-depth explanation of the C++ standard library lists - forward_list and list. It highlights the implementation details and differences between the two types of lists. The forward_list is a singly-linked list, where each element contains a pointer to the next element. On the other hand, the list is a doubly-linked list with a circular structure and a sentinel node marking the beginning and end of the list. The article also mentions the different implementations of the sentinel node - embedded or external - used by different compilers. The author provides insights into how to access and view the contents of these lists using the Microsoft implementation of the standard library. Overall, the article serves as a useful guide for developers working with lists in C++ and provides valuable information for those interested in understanding the internals of the STL.