Init
This commit is contained in:
55
cppdraft/queue/cons.md
Normal file
55
cppdraft/queue/cons.md
Normal file
@@ -0,0 +1,55 @@
|
||||
[queue.cons]
|
||||
|
||||
# 23 Containers library [[containers]](./#containers)
|
||||
|
||||
## 23.6 Container adaptors [[container.adaptors]](container.adaptors#queue.cons)
|
||||
|
||||
### 23.6.3 Class template queue [[queue]](queue#cons)
|
||||
|
||||
#### 23.6.3.2 Constructors [queue.cons]
|
||||
|
||||
[ð](#lib:queue,constructor)
|
||||
|
||||
`constexpr explicit queue(const Container& cont);
|
||||
`
|
||||
|
||||
[1](#1)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L15733)
|
||||
|
||||
*Effects*: Initializes c with cont[.](#1.sentence-1)
|
||||
|
||||
[ð](#lib:queue,constructor_)
|
||||
|
||||
`constexpr explicit queue(Container&& cont);
|
||||
`
|
||||
|
||||
[2](#2)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L15744)
|
||||
|
||||
*Effects*: Initializes c with std::move(cont)[.](#2.sentence-1)
|
||||
|
||||
[ð](#lib:queue,constructor__)
|
||||
|
||||
`template<class InputIterator>
|
||||
constexpr queue(InputIterator first, InputIterator last);
|
||||
`
|
||||
|
||||
[3](#3)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L15756)
|
||||
|
||||
*Effects*: Initializes c withfirst as the first argument and last as the second argument[.](#3.sentence-1)
|
||||
|
||||
[ð](#lib:queue,constructor___)
|
||||
|
||||
`template<[container-compatible-range](container.intro.reqmts#concept:container-compatible-range "23.2.2.1 Introduction [container.intro.reqmts]")<T> R>
|
||||
constexpr queue(from_range_t, R&& rg);
|
||||
`
|
||||
|
||||
[4](#4)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L15769)
|
||||
|
||||
*Effects*: Initializes c with ranges::to<Container>(std::forward<R>(rg))[.](#4.sentence-1)
|
||||
95
cppdraft/queue/cons/alloc.md
Normal file
95
cppdraft/queue/cons/alloc.md
Normal file
@@ -0,0 +1,95 @@
|
||||
[queue.cons.alloc]
|
||||
|
||||
# 23 Containers library [[containers]](./#containers)
|
||||
|
||||
## 23.6 Container adaptors [[container.adaptors]](container.adaptors#queue.cons.alloc)
|
||||
|
||||
### 23.6.3 Class template queue [[queue]](queue#cons.alloc)
|
||||
|
||||
#### 23.6.3.3 Constructors with allocators [queue.cons.alloc]
|
||||
|
||||
[1](#1)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L15776)
|
||||
|
||||
If uses_allocator_v<container_type, Alloc> is false the constructors in this subclause shall not participate in overload resolution[.](#1.sentence-1)
|
||||
|
||||
[ð](#lib:queue,constructor)
|
||||
|
||||
`template<class Alloc> constexpr explicit queue(const Alloc& a);
|
||||
`
|
||||
|
||||
[2](#2)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L15786)
|
||||
|
||||
*Effects*: Initializes c with a[.](#2.sentence-1)
|
||||
|
||||
[ð](#lib:queue,constructor_)
|
||||
|
||||
`template<class Alloc> constexpr queue(const container_type& cont, const Alloc& a);
|
||||
`
|
||||
|
||||
[3](#3)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L15797)
|
||||
|
||||
*Effects*: Initializes c with cont as the first argument and a as the second argument[.](#3.sentence-1)
|
||||
|
||||
[ð](#lib:queue,constructor__)
|
||||
|
||||
`template<class Alloc> constexpr queue(container_type&& cont, const Alloc& a);
|
||||
`
|
||||
|
||||
[4](#4)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L15809)
|
||||
|
||||
*Effects*: Initializes c with std::move(cont) as the first argument and a as the second argument[.](#4.sentence-1)
|
||||
|
||||
[ð](#lib:queue,constructor___)
|
||||
|
||||
`template<class Alloc> constexpr queue(const queue& q, const Alloc& a);
|
||||
`
|
||||
|
||||
[5](#5)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L15821)
|
||||
|
||||
*Effects*: Initializes c with q.c as the first argument and a as the
|
||||
second argument[.](#5.sentence-1)
|
||||
|
||||
[ð](#lib:queue,constructor____)
|
||||
|
||||
`template<class Alloc> constexpr queue(queue&& q, const Alloc& a);
|
||||
`
|
||||
|
||||
[6](#6)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L15833)
|
||||
|
||||
*Effects*: Initializes c with std::move(q.c) as the first argument and a as the second argument[.](#6.sentence-1)
|
||||
|
||||
[ð](#lib:queue,constructor_____)
|
||||
|
||||
`template<class InputIterator, class Alloc>
|
||||
constexpr queue(InputIterator first, InputIterator last, const Alloc& alloc);
|
||||
`
|
||||
|
||||
[7](#7)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L15846)
|
||||
|
||||
*Effects*: Initializes c withfirst as the first argument,last as the second argument, andalloc as the third argument[.](#7.sentence-1)
|
||||
|
||||
[ð](#lib:queue,constructor______)
|
||||
|
||||
`template<[container-compatible-range](container.intro.reqmts#concept:container-compatible-range "23.2.2.1 Introduction [container.intro.reqmts]")<T> R, class Alloc>
|
||||
constexpr queue(from_range_t, R&& rg, const Alloc& a);
|
||||
`
|
||||
|
||||
[8](#8)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L15861)
|
||||
|
||||
*Effects*: Initializes c withranges::to<Container>(std::forward<R>(rg), a)[.](#8.sentence-1)
|
||||
20
cppdraft/queue/defn.md
Normal file
20
cppdraft/queue/defn.md
Normal file
@@ -0,0 +1,20 @@
|
||||
[queue.defn]
|
||||
|
||||
# 23 Containers library [[containers]](./#containers)
|
||||
|
||||
## 23.6 Container adaptors [[container.adaptors]](container.adaptors#queue.defn)
|
||||
|
||||
### 23.6.3 Class template queue [[queue]](queue#defn)
|
||||
|
||||
#### 23.6.3.1 Definition [queue.defn]
|
||||
|
||||
[1](#1)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L15635)
|
||||
|
||||
Any sequence container supporting operationsfront(),back(),push_back() andpop_front() can be used to instantiatequeue[.](#1.sentence-1)
|
||||
|
||||
In particular,<list> and<deque> can be used[.](#1.sentence-2)
|
||||
|
||||
namespace std {template<class T, class Container = deque<T>>class queue {public:using value_type = typename Container::value_type; using reference = typename Container::reference; using const_reference = typename Container::const_reference; using size_type = typename Container::size_type; using container_type = Container; protected: Container c; public:constexpr queue() : queue(Container()) {}constexpr explicit queue(const Container&); constexpr explicit queue(Container&&); template<class InputIterator> constexpr queue(InputIterator first, InputIterator last); template<[*container-compatible-range*](container.intro.reqmts#concept:container-compatible-range "23.2.2.1 Introduction [container.intro.reqmts]")<T> R> constexpr queue(from_range_t, R&& rg); template<class Alloc> constexpr explicit queue(const Alloc&); template<class Alloc> constexpr queue(const Container&, const Alloc&); template<class Alloc> constexpr queue(Container&&, const Alloc&); template<class Alloc> constexpr queue(const queue&, const Alloc&); template<class Alloc> constexpr queue(queue&&, const Alloc&); template<class InputIterator, class Alloc>constexpr queue(InputIterator first, InputIterator last, const Alloc&); template<[*container-compatible-range*](container.intro.reqmts#concept:container-compatible-range "23.2.2.1 Introduction [container.intro.reqmts]")<T> R, class Alloc>constexpr queue(from_range_t, R&& rg, const Alloc&); constexpr bool empty() const { return c.empty(); }constexpr size_type size() const { return c.size(); }constexpr reference front() { return c.front(); }constexpr const_reference front() const { return c.front(); }constexpr reference back() { return c.back(); }constexpr const_reference back() const { return c.back(); }constexpr void push(const value_type& x) { c.push_back(x); }constexpr void push(value_type&& x) { c.push_back(std::move(x)); }template<[*container-compatible-range*](container.intro.reqmts#concept:container-compatible-range "23.2.2.1 Introduction [container.intro.reqmts]")<T> R> constexpr void push_range(R&& rg); template<class... Args>constexpr decltype(auto) emplace(Args&&... args){ return c.emplace_back(std::forward<Args>(args)...); }constexpr void pop() { c.pop_front(); }constexpr void swap(queue& q) noexcept(is_nothrow_swappable_v<Container>){ using std::swap; swap(c, q.c); }}; template<class Container> queue(Container) -> queue<typename Container::value_type, Container>; template<class InputIterator> queue(InputIterator, InputIterator) -> queue<*iter-value-type*<InputIterator>>; template<ranges::[input_range](range.refinements#concept:input_range "25.4.6 Other range refinements [range.refinements]") R> queue(from_range_t, R&&) -> queue<ranges::range_value_t<R>>; template<class Container, class Allocator> queue(Container, Allocator) -> queue<typename Container::value_type, Container>; template<class InputIterator, class Allocator> queue(InputIterator, InputIterator, Allocator)-> queue<*iter-value-type*<InputIterator>, deque<*iter-value-type*<InputIterator>,
|
||||
Allocator>>; template<ranges::[input_range](range.refinements#concept:input_range "25.4.6 Other range refinements [range.refinements]") R, class Allocator> queue(from_range_t, R&&, Allocator)-> queue<ranges::range_value_t<R>, deque<ranges::range_value_t<R>, Allocator>>; template<class T, class Container, class Alloc>struct uses_allocator<queue<T, Container>, Alloc>: uses_allocator<Container, Alloc>::type { };}
|
||||
22
cppdraft/queue/mod.md
Normal file
22
cppdraft/queue/mod.md
Normal file
@@ -0,0 +1,22 @@
|
||||
[queue.mod]
|
||||
|
||||
# 23 Containers library [[containers]](./#containers)
|
||||
|
||||
## 23.6 Container adaptors [[container.adaptors]](container.adaptors#queue.mod)
|
||||
|
||||
### 23.6.3 Class template queue [[queue]](queue#mod)
|
||||
|
||||
#### 23.6.3.4 Modifiers [queue.mod]
|
||||
|
||||
[ð](#lib:push_range,queue)
|
||||
|
||||
`template<[container-compatible-range](container.intro.reqmts#concept:container-compatible-range "23.2.2.1 Introduction [container.intro.reqmts]")<T> R>
|
||||
constexpr void push_range(R&& rg);
|
||||
`
|
||||
|
||||
[1](#1)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L15876)
|
||||
|
||||
*Effects*: Equivalent to c.append_range(std::forward<R>(rg)) if that is a valid expression,
|
||||
otherwise ranges::copy(rg, back_inserter(c))[.](#1.sentence-1)
|
||||
94
cppdraft/queue/ops.md
Normal file
94
cppdraft/queue/ops.md
Normal file
@@ -0,0 +1,94 @@
|
||||
[queue.ops]
|
||||
|
||||
# 23 Containers library [[containers]](./#containers)
|
||||
|
||||
## 23.6 Container adaptors [[container.adaptors]](container.adaptors#queue.ops)
|
||||
|
||||
### 23.6.3 Class template queue [[queue]](queue#ops)
|
||||
|
||||
#### 23.6.3.5 Operators [queue.ops]
|
||||
|
||||
[ð](#lib:operator==,queue)
|
||||
|
||||
`template<class T, class Container>
|
||||
constexpr bool operator==(const queue<T, Container>& x, const queue<T, Container>& y);
|
||||
`
|
||||
|
||||
[1](#1)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L15892)
|
||||
|
||||
*Returns*: x.c == y.c[.](#1.sentence-1)
|
||||
|
||||
[ð](#lib:operator!=,queue)
|
||||
|
||||
`template<class T, class Container>
|
||||
constexpr bool operator!=(const queue<T, Container>& x, const queue<T, Container>& y);
|
||||
`
|
||||
|
||||
[2](#2)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L15904)
|
||||
|
||||
*Returns*: x.c != y.c[.](#2.sentence-1)
|
||||
|
||||
[ð](#lib:operator%3c,queue)
|
||||
|
||||
`template<class T, class Container>
|
||||
constexpr bool operator< (const queue<T, Container>& x, const queue<T, Container>& y);
|
||||
`
|
||||
|
||||
[3](#3)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L15916)
|
||||
|
||||
*Returns*: x.c < y.c[.](#3.sentence-1)
|
||||
|
||||
[ð](#lib:operator%3e,queue)
|
||||
|
||||
`template<class T, class Container>
|
||||
constexpr bool operator> (const queue<T, Container>& x, const queue<T, Container>& y);
|
||||
`
|
||||
|
||||
[4](#4)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L15928)
|
||||
|
||||
*Returns*: x.c > y.c[.](#4.sentence-1)
|
||||
|
||||
[ð](#lib:operator%3c=,queue)
|
||||
|
||||
`template<class T, class Container>
|
||||
constexpr bool operator<=(const queue<T, Container>& x, const queue<T, Container>& y);
|
||||
`
|
||||
|
||||
[5](#5)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L15940)
|
||||
|
||||
*Returns*: x.c <= y.c[.](#5.sentence-1)
|
||||
|
||||
[ð](#lib:operator%3e=,queue)
|
||||
|
||||
`template<class T, class Container>
|
||||
constexpr bool operator>=(const queue<T, Container>& x, const queue<T, Container>& y);
|
||||
`
|
||||
|
||||
[6](#6)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L15952)
|
||||
|
||||
*Returns*: x.c >= y.c[.](#6.sentence-1)
|
||||
|
||||
[ð](#lib:operator%3c=%3e,queue)
|
||||
|
||||
`template<class T, [three_way_comparable](cmp.concept#concept:three_way_comparable "17.12.4 Concept three_way_comparable [cmp.concept]") Container>
|
||||
constexpr compare_three_way_result_t<Container>
|
||||
operator<=>(const queue<T, Container>& x, const queue<T, Container>& y);
|
||||
`
|
||||
|
||||
[7](#7)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L15965)
|
||||
|
||||
*Returns*: x.c <=> y.c[.](#7.sentence-1)
|
||||
28
cppdraft/queue/special.md
Normal file
28
cppdraft/queue/special.md
Normal file
@@ -0,0 +1,28 @@
|
||||
[queue.special]
|
||||
|
||||
# 23 Containers library [[containers]](./#containers)
|
||||
|
||||
## 23.6 Container adaptors [[container.adaptors]](container.adaptors#queue.special)
|
||||
|
||||
### 23.6.3 Class template queue [[queue]](queue#special)
|
||||
|
||||
#### 23.6.3.6 Specialized algorithms [queue.special]
|
||||
|
||||
[ð](#lib:swap,queue)
|
||||
|
||||
`template<class T, class Container>
|
||||
constexpr void swap(queue<T, Container>& x, queue<T, Container>& y)
|
||||
noexcept(noexcept(x.swap(y)));
|
||||
`
|
||||
|
||||
[1](#1)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L15980)
|
||||
|
||||
*Constraints*: is_swappable_v<Container> is true[.](#1.sentence-1)
|
||||
|
||||
[2](#2)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L15984)
|
||||
|
||||
*Effects*: As if by x.swap(y)[.](#2.sentence-1)
|
||||
12
cppdraft/queue/syn.md
Normal file
12
cppdraft/queue/syn.md
Normal file
@@ -0,0 +1,12 @@
|
||||
[queue.syn]
|
||||
|
||||
# 23 Containers library [[containers]](./#containers)
|
||||
|
||||
## 23.6 Container adaptors [[container.adaptors]](container.adaptors#queue.syn)
|
||||
|
||||
### 23.6.2 Header <queue> synopsis [queue.syn]
|
||||
|
||||
[ð](#header:%3cqueue%3e)
|
||||
|
||||
#include <compare> // see [[compare.syn]](compare.syn "17.12.1 Header <compare> synopsis")#include <initializer_list> // see [[initializer.list.syn]](initializer.list.syn "17.11.2 Header <initializer_list> synopsis")namespace std {// [[queue]](queue "23.6.3 Class template queue"), class template queuetemplate<class T, class Container = deque<T>> class queue; template<class T, class Container>constexpr bool operator==(const queue<T, Container>& x, const queue<T, Container>& y); template<class T, class Container>constexpr bool operator!=(const queue<T, Container>& x, const queue<T, Container>& y); template<class T, class Container>constexpr bool operator< (const queue<T, Container>& x, const queue<T, Container>& y); template<class T, class Container>constexpr bool operator> (const queue<T, Container>& x, const queue<T, Container>& y); template<class T, class Container>constexpr bool operator<=(const queue<T, Container>& x, const queue<T, Container>& y); template<class T, class Container>constexpr bool operator>=(const queue<T, Container>& x, const queue<T, Container>& y); template<class T, [three_way_comparable](cmp.concept#concept:three_way_comparable "17.12.4 Concept three_way_comparable [cmp.concept]") Container>constexpr compare_three_way_result_t<Container>operator<=>(const queue<T, Container>& x, const queue<T, Container>& y); template<class T, class Container>constexpr void swap(queue<T, Container>& x, queue<T, Container>& y)noexcept(noexcept(x.swap(y))); template<class T, class Container, class Alloc>struct uses_allocator<queue<T, Container>, Alloc>; // [[container.adaptors.format]](container.adaptors.format "23.6.13 Container adaptors formatting"), formatter specialization for queuetemplate<class charT, class T, [formattable](format.formattable#concept:formattable "28.5.6.3 Concept formattable [format.formattable]")<charT> Container>struct formatter<queue<T, Container>, charT>; // [[priority.queue]](priority.queue "23.6.4 Class template priority_queue"), class template priority_queuetemplate<class T, class Container = vector<T>, class Compare = less<typename Container::value_type>>class priority_queue; template<class T, class Container, class Compare>constexpr void swap(priority_queue<T, Container, Compare>& x,
|
||||
priority_queue<T, Container, Compare>& y) noexcept(noexcept(x.swap(y))); template<class T, class Container, class Compare, class Alloc>struct uses_allocator<priority_queue<T, Container, Compare>, Alloc>; // [[container.adaptors.format]](container.adaptors.format "23.6.13 Container adaptors formatting"), formatter specialization for priority_queuetemplate<class charT, class T, [formattable](format.formattable#concept:formattable "28.5.6.3 Concept formattable [format.formattable]")<charT> Container, class Compare>struct formatter<priority_queue<T, Container, Compare>, charT>;}
|
||||
Reference in New Issue
Block a user