Files
cppdraft_translate/cppdraft/deque/cons.md
2025-10-25 03:02:53 +03:00

114 lines
3.3 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[deque.cons]
# 23 Containers library [[containers]](./#containers)
## 23.3 Sequence containers [[sequences]](sequences#deque.cons)
### 23.3.5 Class template deque [[deque]](deque#cons)
#### 23.3.5.2 Constructors, copy, and assignment [deque.cons]
[🔗](#lib:deque,constructor)
`constexpr explicit deque(const Allocator&);
`
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L6624)
*Effects*: Constructs an emptydeque,
using the specified allocator[.](#1.sentence-1)
[2](#2)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L6630)
*Complexity*: Constant[.](#2.sentence-1)
[🔗](#lib:deque,constructor_)
`constexpr explicit deque(size_type n, const Allocator& = Allocator());
`
[3](#3)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L6641)
*Preconditions*: T is *Cpp17DefaultInsertable* into deque[.](#3.sentence-1)
[4](#4)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L6645)
*Effects*: Constructs a deque withn default-inserted elements using the specified allocator[.](#4.sentence-1)
[5](#5)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L6650)
*Complexity*: Linear in n[.](#5.sentence-1)
[🔗](#lib:deque,constructor__)
`constexpr deque(size_type n, const T& value, const Allocator& = Allocator());
`
[6](#6)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L6661)
*Preconditions*: T is *Cpp17CopyInsertable* into deque[.](#6.sentence-1)
[7](#7)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L6665)
*Effects*: Constructs adeque with n copies of value,
using the specified allocator[.](#7.sentence-1)
[8](#8)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L6672)
*Complexity*: Linear in n[.](#8.sentence-1)
[🔗](#lib:deque,constructor___)
`template<class InputIterator>
constexpr deque(InputIterator first, InputIterator last, const Allocator& = Allocator());
`
[9](#9)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L6684)
*Effects*: Constructs adeque equal to the range
[first, last),
using the specified allocator[.](#9.sentence-1)
[10](#10)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L6692)
*Complexity*: Linear in distance(first, last)[.](#10.sentence-1)
[🔗](#lib:deque,constructor____)
`template<[container-compatible-range](container.intro.reqmts#concept:container-compatible-range "23.2.2.1Introduction[container.intro.reqmts]")<T> R>
constexpr deque(from_range_t, R&& rg, const Allocator& = Allocator());
`
[11](#11)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L6704)
*Effects*: Constructs a deque with the elements of the range rg,
using the specified allocator[.](#11.sentence-1)
[12](#12)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L6709)
*Complexity*: Linear in ranges::distance(rg)[.](#12.sentence-1)