cptr::forward_list

A singly linked list with 4-byte links, like std::forward_list without the allocator parameter.

Synopsis

Declared in <cptr/forward_list.hpp>

template<
    class T,
    class Cage = default_cage>
using forward_list = detail::basic_forward_list<T, Cage, true>;

Description

Nodes are allocated in Cage; an empty list allocates nothing. The members are those of std::forward_list and behave like them, including the exception guarantees; the only difference is that there is no allocator parameter (and so no get_allocator()). See detail::basic_forward_list for the full member list.


#include "cptr/forward_list.hpp"

cptr::forward_list<int> f{3, 1, 2};
f.push_front(0);
f.sort();