From Jason Turner

[deque.overview]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpkgj30a_m/{from.md → to.md} +25 -15
tmp/tmpkgj30a_m/{from.md → to.md} RENAMED
@@ -5,17 +5,18 @@ A `deque` is a sequence container that supports random access iterators
5
  insert and erase operations at the beginning or the end; insert and
6
  erase in the middle take linear time. That is, a deque is especially
7
  optimized for pushing and popping elements at the beginning and end.
8
  Storage management is handled automatically.
9
 
10
- A `deque` meets all of the requirements of a container, of a reversible
11
- container (given in tables in  [[container.requirements]]), of a
12
- sequence container, including the optional sequence container
13
- requirements [[sequence.reqmts]], and of an allocator-aware container (
14
- [[container.alloc.req]]). Descriptions are provided here only for
15
- operations on `deque` that are not described in one of these tables or
16
- for operations where there is additional semantic information.
 
17
 
18
  ``` cpp
19
  namespace std {
20
  template<class T, class Allocator = allocator<T>>
21
  class deque {
@@ -25,12 +26,12 @@ namespace std {
25
  using allocator_type = Allocator;
26
  using pointer = typename allocator_traits<Allocator>::pointer;
27
  using const_pointer = typename allocator_traits<Allocator>::const_pointer;
28
  using reference = value_type&;
29
  using const_reference = const value_type&;
30
- using size_type = implementation-defined; // see [container.requirements]
31
- using difference_type = implementation-defined; // see [container.requirements]
32
  using iterator = implementation-defined // type of deque::iterator; // see [container.requirements]
33
  using const_iterator = implementation-defined // type of deque::const_iterator; // see [container.requirements]
34
  using reverse_iterator = std::reverse_iterator<iterator>;
35
  using const_reverse_iterator = std::reverse_iterator<const_iterator>;
36
 
@@ -39,23 +40,27 @@ namespace std {
39
  explicit deque(const Allocator&);
40
  explicit deque(size_type n, const Allocator& = Allocator());
41
  deque(size_type n, const T& value, const Allocator& = Allocator());
42
  template<class InputIterator>
43
  deque(InputIterator first, InputIterator last, const Allocator& = Allocator());
 
 
44
  deque(const deque& x);
45
  deque(deque&&);
46
- deque(const deque&, const Allocator&);
47
- deque(deque&&, const Allocator&);
48
  deque(initializer_list<T>, const Allocator& = Allocator());
49
 
50
  ~deque();
51
  deque& operator=(const deque& x);
52
  deque& operator=(deque&& x)
53
  noexcept(allocator_traits<Allocator>::is_always_equal::value);
54
  deque& operator=(initializer_list<T>);
55
  template<class InputIterator>
56
  void assign(InputIterator first, InputIterator last);
 
 
57
  void assign(size_type n, const T& t);
58
  void assign(initializer_list<T>);
59
  allocator_type get_allocator() const noexcept;
60
 
61
  // iterators
@@ -96,18 +101,24 @@ namespace std {
96
  template<class... Args> reference emplace_back(Args&&... args);
97
  template<class... Args> iterator emplace(const_iterator position, Args&&... args);
98
 
99
  void push_front(const T& x);
100
  void push_front(T&& x);
 
 
101
  void push_back(const T& x);
102
  void push_back(T&& x);
 
 
103
 
104
  iterator insert(const_iterator position, const T& x);
105
  iterator insert(const_iterator position, T&& x);
106
  iterator insert(const_iterator position, size_type n, const T& x);
107
  template<class InputIterator>
108
  iterator insert(const_iterator position, InputIterator first, InputIterator last);
 
 
109
  iterator insert(const_iterator position, initializer_list<T>);
110
 
111
  void pop_front();
112
  void pop_back();
113
 
@@ -120,12 +131,11 @@ namespace std {
120
 
121
  template<class InputIterator, class Allocator = allocator<iter-value-type<InputIterator>>>
122
  deque(InputIterator, InputIterator, Allocator = Allocator())
123
  -> deque<iter-value-type<InputIterator>, Allocator>;
124
 
125
- // swap
126
- template<class T, class Allocator>
127
- void swap(deque<T, Allocator>& x, deque<T, Allocator>& y)
128
- noexcept(noexcept(x.swap(y)));
129
  }
130
  ```
131
 
 
5
  insert and erase operations at the beginning or the end; insert and
6
  erase in the middle take linear time. That is, a deque is especially
7
  optimized for pushing and popping elements at the beginning and end.
8
  Storage management is handled automatically.
9
 
10
+ A `deque` meets all of the requirements of a container
11
+ [[container.reqmts]], of a reversible container
12
+ [[container.rev.reqmts]], of an allocator-aware container
13
+ [[container.alloc.reqmts]], and of a sequence container, including the
14
+ optional sequence container requirements [[sequence.reqmts]].
15
+ Descriptions are provided here only for operations on `deque` that are
16
+ not described in one of these tables or for operations where there is
17
+ additional semantic information.
18
 
19
  ``` cpp
20
  namespace std {
21
  template<class T, class Allocator = allocator<T>>
22
  class deque {
 
26
  using allocator_type = Allocator;
27
  using pointer = typename allocator_traits<Allocator>::pointer;
28
  using const_pointer = typename allocator_traits<Allocator>::const_pointer;
29
  using reference = value_type&;
30
  using const_reference = const value_type&;
31
+ using size_type = implementation-defined // type of deque::size_type; // see [container.requirements]
32
+ using difference_type = implementation-defined // type of deque::difference_type; // see [container.requirements]
33
  using iterator = implementation-defined // type of deque::iterator; // see [container.requirements]
34
  using const_iterator = implementation-defined // type of deque::const_iterator; // see [container.requirements]
35
  using reverse_iterator = std::reverse_iterator<iterator>;
36
  using const_reverse_iterator = std::reverse_iterator<const_iterator>;
37
 
 
40
  explicit deque(const Allocator&);
41
  explicit deque(size_type n, const Allocator& = Allocator());
42
  deque(size_type n, const T& value, const Allocator& = Allocator());
43
  template<class InputIterator>
44
  deque(InputIterator first, InputIterator last, const Allocator& = Allocator());
45
+ template<container-compatible-range<T> R>
46
+ deque(from_range_t, R&& rg, const Allocator& = Allocator());
47
  deque(const deque& x);
48
  deque(deque&&);
49
+ deque(const deque&, const type_identity_t<Allocator>&);
50
+ deque(deque&&, const type_identity_t<Allocator>&);
51
  deque(initializer_list<T>, const Allocator& = Allocator());
52
 
53
  ~deque();
54
  deque& operator=(const deque& x);
55
  deque& operator=(deque&& x)
56
  noexcept(allocator_traits<Allocator>::is_always_equal::value);
57
  deque& operator=(initializer_list<T>);
58
  template<class InputIterator>
59
  void assign(InputIterator first, InputIterator last);
60
+ template<container-compatible-range<T> R>
61
+ void assign_range(R&& rg);
62
  void assign(size_type n, const T& t);
63
  void assign(initializer_list<T>);
64
  allocator_type get_allocator() const noexcept;
65
 
66
  // iterators
 
101
  template<class... Args> reference emplace_back(Args&&... args);
102
  template<class... Args> iterator emplace(const_iterator position, Args&&... args);
103
 
104
  void push_front(const T& x);
105
  void push_front(T&& x);
106
+ template<container-compatible-range<T> R>
107
+ void prepend_range(R&& rg);
108
  void push_back(const T& x);
109
  void push_back(T&& x);
110
+ template<container-compatible-range<T> R>
111
+ void append_range(R&& rg);
112
 
113
  iterator insert(const_iterator position, const T& x);
114
  iterator insert(const_iterator position, T&& x);
115
  iterator insert(const_iterator position, size_type n, const T& x);
116
  template<class InputIterator>
117
  iterator insert(const_iterator position, InputIterator first, InputIterator last);
118
+ template<container-compatible-range<T> R>
119
+ iterator insert_range(const_iterator position, R&& rg);
120
  iterator insert(const_iterator position, initializer_list<T>);
121
 
122
  void pop_front();
123
  void pop_back();
124
 
 
131
 
132
  template<class InputIterator, class Allocator = allocator<iter-value-type<InputIterator>>>
133
  deque(InputIterator, InputIterator, Allocator = Allocator())
134
  -> deque<iter-value-type<InputIterator>, Allocator>;
135
 
136
+ template<ranges::input_range R, class Allocator = allocator<ranges::range_value_t<R>>>
137
+ deque(from_range_t, R&&, Allocator = Allocator())
138
+ -> deque<ranges::range_value_t<R>, Allocator>;
 
139
  }
140
  ```
141