AlgoMaster Logo

std::forward_list

Last Updated: May 17, 2026

10 min read

std::forward_list<T> is a singly-linked list added in C++11: each node stores one element and a single pointer to the next node, with no back-pointer. It exists as a deliberately minimal container that matches the size and behaviour of a hand-written C linked list, trading away a lot of conveniences (no size(), no push_back, no back) for the smallest possible per-node footprint. This chapter covers the node layout, the surprising API quirks that follow from being singly-linked, the before_begin family of operations, the member algorithms (splice_after, merge, sort, remove, reverse, unique), and how to pick between forward_list and std::list.

Premium Content

Subscribe to unlock full access to this content and more premium articles.