tmp/tmp1_tcb8uz/{from.md → to.md}
RENAMED
|
@@ -14,121 +14,125 @@ A `deque` meets all of the requirements of a container
|
|
| 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 {
|
| 23 |
public:
|
| 24 |
// types
|
| 25 |
using value_type = T;
|
| 26 |
using allocator_type = Allocator;
|
| 27 |
-
using pointer =
|
| 28 |
-
using 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 |
|
| 38 |
// [deque.cons], construct/copy/destroy
|
| 39 |
-
deque() : deque(Allocator()) { }
|
| 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
|
| 67 |
-
iterator begin() noexcept;
|
| 68 |
-
const_iterator begin() const noexcept;
|
| 69 |
-
iterator end() noexcept;
|
| 70 |
-
const_iterator end() const noexcept;
|
| 71 |
-
reverse_iterator rbegin() noexcept;
|
| 72 |
-
const_reverse_iterator rbegin() const noexcept;
|
| 73 |
-
reverse_iterator rend() noexcept;
|
| 74 |
-
const_reverse_iterator rend() const noexcept;
|
| 75 |
|
| 76 |
-
const_iterator cbegin() const noexcept;
|
| 77 |
-
const_iterator cend() const noexcept;
|
| 78 |
-
const_reverse_iterator crbegin() const noexcept;
|
| 79 |
-
const_reverse_iterator crend() const noexcept;
|
| 80 |
|
| 81 |
// [deque.capacity], capacity
|
| 82 |
-
|
| 83 |
-
size_type size() const noexcept;
|
| 84 |
-
size_type max_size() const noexcept;
|
| 85 |
-
void resize(size_type sz);
|
| 86 |
-
void resize(size_type sz, const T& c);
|
| 87 |
-
void shrink_to_fit();
|
| 88 |
|
| 89 |
// element access
|
| 90 |
-
reference operator[](size_type n);
|
| 91 |
-
const_reference operator[](size_type n) const;
|
| 92 |
-
reference at(size_type n);
|
| 93 |
-
const_reference at(size_type n) const;
|
| 94 |
-
reference front();
|
| 95 |
-
const_reference front() const;
|
| 96 |
-
reference back();
|
| 97 |
-
const_reference back() const;
|
| 98 |
|
| 99 |
// [deque.modifiers], modifiers
|
| 100 |
-
template<class... Args> reference emplace_front(Args&&... args);
|
| 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,
|
|
|
|
| 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 |
|
| 125 |
-
iterator erase(const_iterator position);
|
| 126 |
-
iterator erase(const_iterator first, const_iterator last);
|
| 127 |
-
void swap(deque&)
|
| 128 |
noexcept(allocator_traits<Allocator>::is_always_equal::value);
|
| 129 |
-
void clear() noexcept;
|
| 130 |
};
|
| 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>;
|
|
|
|
| 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 |
+
The types `iterator` and `const_iterator` meet the constexpr iterator
|
| 20 |
+
requirements [[iterator.requirements.general]].
|
| 21 |
+
|
| 22 |
``` cpp
|
| 23 |
namespace std {
|
| 24 |
template<class T, class Allocator = allocator<T>>
|
| 25 |
class deque {
|
| 26 |
public:
|
| 27 |
// types
|
| 28 |
using value_type = T;
|
| 29 |
using allocator_type = Allocator;
|
| 30 |
+
using pointer = allocator_traits<Allocator>::pointer;
|
| 31 |
+
using const_pointer = allocator_traits<Allocator>::const_pointer;
|
| 32 |
using reference = value_type&;
|
| 33 |
using const_reference = const value_type&;
|
| 34 |
using size_type = implementation-defined // type of deque::size_type; // see [container.requirements]
|
| 35 |
using difference_type = implementation-defined // type of deque::difference_type; // see [container.requirements]
|
| 36 |
using iterator = implementation-defined // type of deque::iterator; // see [container.requirements]
|
| 37 |
using const_iterator = implementation-defined // type of deque::const_iterator; // see [container.requirements]
|
| 38 |
using reverse_iterator = std::reverse_iterator<iterator>;
|
| 39 |
using const_reverse_iterator = std::reverse_iterator<const_iterator>;
|
| 40 |
|
| 41 |
// [deque.cons], construct/copy/destroy
|
| 42 |
+
constexpr deque() : deque(Allocator()) { }
|
| 43 |
+
constexpr explicit deque(const Allocator&);
|
| 44 |
+
constexpr explicit deque(size_type n, const Allocator& = Allocator());
|
| 45 |
+
constexpr deque(size_type n, const T& value, const Allocator& = Allocator());
|
| 46 |
template<class InputIterator>
|
| 47 |
+
constexpr deque(InputIterator first, InputIterator last, const Allocator& = Allocator());
|
| 48 |
template<container-compatible-range<T> R>
|
| 49 |
+
constexpr deque(from_range_t, R&& rg, const Allocator& = Allocator());
|
| 50 |
+
constexpr deque(const deque& x);
|
| 51 |
+
constexpr deque(deque&&);
|
| 52 |
+
constexpr deque(const deque&, const type_identity_t<Allocator>&);
|
| 53 |
+
constexpr deque(deque&&, const type_identity_t<Allocator>&);
|
| 54 |
+
constexpr deque(initializer_list<T>, const Allocator& = Allocator());
|
| 55 |
|
| 56 |
+
constexpr ~deque();
|
| 57 |
+
constexpr deque& operator=(const deque& x);
|
| 58 |
+
constexpr deque& operator=(deque&& x)
|
| 59 |
noexcept(allocator_traits<Allocator>::is_always_equal::value);
|
| 60 |
+
constexpr deque& operator=(initializer_list<T>);
|
| 61 |
template<class InputIterator>
|
| 62 |
+
constexpr void assign(InputIterator first, InputIterator last);
|
| 63 |
template<container-compatible-range<T> R>
|
| 64 |
+
constexpr void assign_range(R&& rg);
|
| 65 |
+
constexpr void assign(size_type n, const T& t);
|
| 66 |
+
constexpr void assign(initializer_list<T>);
|
| 67 |
+
constexpr allocator_type get_allocator() const noexcept;
|
| 68 |
|
| 69 |
// iterators
|
| 70 |
+
constexpr iterator begin() noexcept;
|
| 71 |
+
constexpr const_iterator begin() const noexcept;
|
| 72 |
+
constexpr iterator end() noexcept;
|
| 73 |
+
constexpr const_iterator end() const noexcept;
|
| 74 |
+
constexpr reverse_iterator rbegin() noexcept;
|
| 75 |
+
constexpr const_reverse_iterator rbegin() const noexcept;
|
| 76 |
+
constexpr reverse_iterator rend() noexcept;
|
| 77 |
+
constexpr const_reverse_iterator rend() const noexcept;
|
| 78 |
|
| 79 |
+
constexpr const_iterator cbegin() const noexcept;
|
| 80 |
+
constexpr const_iterator cend() const noexcept;
|
| 81 |
+
constexpr const_reverse_iterator crbegin() const noexcept;
|
| 82 |
+
constexpr const_reverse_iterator crend() const noexcept;
|
| 83 |
|
| 84 |
// [deque.capacity], capacity
|
| 85 |
+
constexpr bool empty() const noexcept;
|
| 86 |
+
constexpr size_type size() const noexcept;
|
| 87 |
+
constexpr size_type max_size() const noexcept;
|
| 88 |
+
constexpr void resize(size_type sz);
|
| 89 |
+
constexpr void resize(size_type sz, const T& c);
|
| 90 |
+
constexpr void shrink_to_fit();
|
| 91 |
|
| 92 |
// element access
|
| 93 |
+
constexpr reference operator[](size_type n);
|
| 94 |
+
constexpr const_reference operator[](size_type n) const;
|
| 95 |
+
constexpr reference at(size_type n);
|
| 96 |
+
constexpr const_reference at(size_type n) const;
|
| 97 |
+
constexpr reference front();
|
| 98 |
+
constexpr const_reference front() const;
|
| 99 |
+
constexpr reference back();
|
| 100 |
+
constexpr const_reference back() const;
|
| 101 |
|
| 102 |
// [deque.modifiers], modifiers
|
| 103 |
+
template<class... Args> constexpr reference emplace_front(Args&&... args);
|
| 104 |
+
template<class... Args> constexpr reference emplace_back(Args&&... args);
|
| 105 |
+
template<class... Args> constexpr iterator emplace(const_iterator position, Args&&... args);
|
| 106 |
|
| 107 |
+
constexpr void push_front(const T& x);
|
| 108 |
+
constexpr void push_front(T&& x);
|
| 109 |
template<container-compatible-range<T> R>
|
| 110 |
+
constexpr void prepend_range(R&& rg);
|
| 111 |
+
constexpr void push_back(const T& x);
|
| 112 |
+
constexpr void push_back(T&& x);
|
| 113 |
template<container-compatible-range<T> R>
|
| 114 |
+
constexpr void append_range(R&& rg);
|
| 115 |
|
| 116 |
+
constexpr iterator insert(const_iterator position, const T& x);
|
| 117 |
+
constexpr iterator insert(const_iterator position, T&& x);
|
| 118 |
+
constexpr iterator insert(const_iterator position, size_type n, const T& x);
|
| 119 |
template<class InputIterator>
|
| 120 |
+
constexpr iterator insert(const_iterator position,
|
| 121 |
+
InputIterator first, InputIterator last);
|
| 122 |
template<container-compatible-range<T> R>
|
| 123 |
+
constexpr iterator insert_range(const_iterator position, R&& rg);
|
| 124 |
+
constexpr iterator insert(const_iterator position, initializer_list<T>);
|
| 125 |
|
| 126 |
+
constexpr void pop_front();
|
| 127 |
+
constexpr void pop_back();
|
| 128 |
|
| 129 |
+
constexpr iterator erase(const_iterator position);
|
| 130 |
+
constexpr iterator erase(const_iterator first, const_iterator last);
|
| 131 |
+
constexpr void swap(deque&)
|
| 132 |
noexcept(allocator_traits<Allocator>::is_always_equal::value);
|
| 133 |
+
constexpr void clear() noexcept;
|
| 134 |
};
|
| 135 |
|
| 136 |
template<class InputIterator, class Allocator = allocator<iter-value-type<InputIterator>>>
|
| 137 |
deque(InputIterator, InputIterator, Allocator = Allocator())
|
| 138 |
-> deque<iter-value-type<InputIterator>, Allocator>;
|