🌐
cppreference.com
en.cppreference.com › cpp › container › list
std::list - cppreference.com
From cppreference.com · < cpp | container · C++ [edit] Containers library · [edit] std::list · [edit] std::list is a container that supports constant time insertion and removal of elements from anywhere in the container. Fast random access is not supported.
🌐
Cppreference
cppreference.com
cppreference.com
C++ reference C++11, C++14, C++17, C++20, C++23, C++26, C++29 │ Compiler support C++11, C++14, C++17, C++20, C++23, C++26, C++29 · Preprocessor − Comments ASCII chart Basic concepts Keywords Names (lookup) Types (fundamental types) The main function Modules (C++20) Contracts (C++26) ...
🌐
Cplusplus
cplusplus.com › reference › list › list
std::list
Lists are sequence containers that allow constant time insert and erase operations anywhere within the sequence, and iteration in both directions. List containers are implemented as doubly-linked lists; Doubly linked lists can store each of the elements they contain in different and unrelated ...
🌐
Cppreference
en.cppreference.com › w › cpp › container › list › list
std::list<T,Allocator>::list - cppreference.com
From cppreference.com · < cpp‎ | container‎ | list · C++ [edit] Containers library · [edit] std::list · [edit] Constructs a new list from a variety of data sources, optionally using a user supplied allocator alloc. 1) The default constructor since C++11.
🌐
Liu
cppreference-45864d.gitlab-pages.liu.se › en › cpp › container › list.html
std::list - cppreference.com
From cppreference.com · < cpp ‎ | container · C++ Containers library · std::list · std::list is a container that supports constant time insertion and removal of elements from anywhere in the container. Fast random access is not supported. It is usually implemented as a doubly-linked list.
🌐
Cppreference
en.cppreference.com › w › cpp › header › list.html
Standard library header <list> - cppreference.com
November 27, 2023 - From cppreference.com · < cpp‎ | header · C++ [edit] Standard library headers · [edit] This header is part of the containers library. #include <compare> #include <initializer_list> namespace std { // class template list template<class T, class Allocator = allocator<T>> class list; template<class T, class Allocator> bool operator==(const list<T, Allocator>& x, const list<T, Allocator>& y); template<class T, class Allocator> /*synth-three-way-result*/<T> operator<=>(const list<T, Allocator>& x, const list<T, Allocator>& y); template<class T, class Allocator> void swap(list<T, Allocator>& x,
🌐
Pucrs
inf.pucrs.br › ~flash › lapro2ec › cppreference › w › cpp › container › list.html
std::list - Cppreference
Fast random access is not supported. It is implemented as double-linked list. Compared to forward lists this container provides bidirectional iteration capability while being less space efficient. Retrieved from "http://en.cppreference.com/w/cpp/container/list"
🌐
cppreference.com
en.cppreference.com › cpp › container › list › splice
std::list<T,Allocator>::splice - cppreference.com
May 21, 2025 - From cppreference.com · < cpp | container | list · C++ [edit] Containers library · [edit] std::list · [edit] Transfers elements from one list to another. No elements are copied or moved, only the internal pointers of the list nodes are re-pointed. No iterators or references become invalidated, ...
🌐
Lsu
ld2015.scusa.lsu.edu › cppreference › en › cpp › container › list.html
std::list - cppreference.com
From cppreference.com · < cpp‎ | container · C++ Containers library · std::list · std::list is a container that supports constant time insertion and removal of elements from anywhere in the container. Fast random access is not supported. It is usually implemented as a doubly-linked list.
🌐
Cppreference
en.cppreference.com › w › cpp › container › list › operator_cmp.html
operator==,!=,<,<=,>,>=,<=>(std::list) - cppreference.com
From cppreference.com · < cpp‎ | container‎ | list · [edit template] C++ [edit] Containers library · [edit] std::list · [edit] Compares the contents of two lists.
Find elsewhere
🌐
University of Chicago
naipc.uchicago.edu › 2015 › ref › cppreference › en › cpp › container › list › _list.html
std::list::~list - cppreference.com
From cppreference.com · < cpp | container | list · C++ Containers library · std::list · Destructs the container. The destructors of the elements are called and the used storage is deallocated. Note, that if the elements are pointers, the pointed-to objects are not destroyed.
🌐
Pucrs
inf.pucrs.br › flash › progeng2 › cppreference › w › cpp › container › list › list.html
std::list::list - Cppreference
#include <list> #include <string> int main() { // c++0x initializer list syntax: std::list<std::string> words1 {"the", "frogurt", "is", "also", "cursed"}; // words2 == words1 std::list<std::string> words2(words1.begin(), words1.end()); // words3 == words1 std::list<std::string> words3(words1); // words4 is {"Mo", "Mo", "Mo", "Mo", "Mo"} std::list<std::string> words4(words1.size(), "Mo"); return 0; } Retrieved from "http://en.cppreference.com/w/cpp/container/list/list"
🌐
Tfcis
toj.tfcis.org › docs › en › cpp › container › list › list.html
std::list::list - cppreference.com
#include <list> #include <string> #include <iostream> template<typename T> std::ostream& operator<<(std::ostream& s, const std::list<T>& v) { s.put('['); char comma[3] = {'\0', ' ', '\0'}; for (const auto& e : v) { s << comma << e; comma[0] = ','; } return s << ']'; } int main() { // c++11 initializer list syntax: std::list<std::string> words1 {"the", "frogurt", "is", "also", "cursed"}; std::cout << "words1: " << words1 << '\n'; // words2 == words1 std::list<std::string> words2(words1.begin(), words1.end()); std::cout << "words2: " << words2 << '\n'; // words3 == words1 std::list<std::string>
🌐
cppreference.com
en.cppreference.com › cpp › utility › initializer_list
std::initializer_list - cppreference.com
October 20, 2024 - An object of type std::initializer_list<T> is a lightweight proxy object that provides access to an array of objects of type const T (that may be allocated in read-only memory).
🌐
cppreference.com
en.cppreference.com › cpp › container › forward_list
std::forward_list - cppreference.com
April 26, 2025 - From cppreference.com · < cpp | container · C++ [edit] Containers library · [edit] std::forward_list · [edit] std::forward_list is a container that supports fast insertion and removal of elements from anywhere in the container. Fast random access is not supported.
🌐
cppreference.com
en.cppreference.com › cpp › language › list_initialization
List-initialization (since C++11) - cppreference.com
August 6, 2024 - From cppreference.com · < cpp | language · C++ [edit] C++ language · [edit] Initialization · [edit] Initializes an object from a brace-enclosed initializer list. 1 Syntax · 1.1 Direct-list-initialization · 1.2 Copy-list-initialization · 2 Explanation ·
🌐
Open Source China
tool.oschina.net › uploads › apidocs › cpp › en › cpp › container › list › unique.html
std::list::unique - cppreference.com
From cppreference.com · < cpp | container | list · C++ Containers library · std::list · Removes all consecutive duplicate elements from the container. Only the first element in each group of equal elements is left. The first version uses operator== to compare the elements, the second version ...
🌐
cppreference.com
en.cppreference.com › cpp
C++ reference - cppreference.com
C++11, C++14, C++17, C++20, C++23, C++26, C++29 │ Compiler support C++11, C++14, C++17, C++20, C++23, C++26, C++29 · Preprocessor − Comments ASCII chart Basic concepts Keywords Names (lookup) Types (fundamental types) The main function Modules (C++20) Contracts (C++26) Expressions Value ...
🌐
Cppreference
en.cppreference.com › w › cpp › container.html
Containers library - cppreference.com
February 22, 2025 - From cppreference.com · < cpp · C++ [edit] Containers library · [edit] The Containers library is a generic collection of class templates and algorithms that allow programmers to easily implement common data structures like queues, lists and stacks. There are two(until C++11)three(since C++11) classes of containers: sequence containers, associative containers, each of which is designed to support a different set of operations.
🌐
Cppreference
en.cppreference.com › w › cpp › container › array.html
std::array - cppreference.com
August 2, 2024 - #include <algorithm> #include <array> #include <iostream> #include <iterator> #include <string> int main() { // Construction uses aggregate initialization std::array<int, 3> a1{{1, 2, 3}}; // Double-braces required in C++11 prior to // the CWG 1270 revision (not needed in C++11 // after the revision and in C++14 and beyond) std::array<int, 3> a2 = {1, 2, 3}; // Double braces never required after = // Container operations are supported std::sort(a1.begin(), a1.end()); std::ranges::reverse_copy(a2, std::ostream_iterator<int>(std::cout, " ")); std::cout << '\n'; // Ranged for loop is supported st