Is there a linked list predefined library in C++?

Viewed 51778

Is there a linked list in C++ that I could just #include? Or do I need to create my own if I want to use one?

6 Answers

I know this question is quite old, anyway maybe it worth to update it as it's up on the search hits when you look for STD and linked lists:

In addition to what already said by the others (use std::list for a double-linked list), for the most common use case of a single-linked list, std::forward_list should be preferred, because it's optimized for single-linked lists specifically.

Related