NexusForce 1.0.0
A Modern C++ Library with extended functionality, web components, and utility libraries
载入中...
搜索中...
未找到
deque< T, Alloc, BufSize > 模板类 参考

双端队列容器 更多...

#include <deque.hpp>

类 deque< T, Alloc, BufSize > 继承关系图:
[图例]

Public 类型

using pointer = T*
 指针类型
using reference = T&
 引用类型
using const_pointer = const T*
 常量指针类型
using const_reference = const T&
 常量引用类型
using value_type = T
 值类型
using size_type = size_t
 大小类型
using difference_type = ptrdiff_t
 差值类型
using iterator = deque_iterator<false, deque, BufSize>
 迭代器类型
using const_iterator = deque_iterator<true, deque, BufSize>
 常量迭代器类型
using reverse_iterator = _NEFORCE reverse_iterator<iterator>
 反向迭代器类型
using const_reverse_iterator = _NEFORCE reverse_iterator<const_iterator>
 常量反向迭代器类型
using allocator_type = Alloc
 分配器类型

Public 成员函数

 deque ()
 默认构造函数
 deque (const size_type n)
 构造包含n个默认构造元素的双端队列
 deque (const size_type n, const T &value)
 构造包含n个指定值元素的双端队列
template<typename Iterator, enable_if_t< is_iter_v< Iterator >, int > = 0>
 deque (Iterator first, Iterator last)
 范围构造函数
 deque (std::initializer_list< T > ilist)
 初始化列表构造函数
dequeoperator= (std::initializer_list< T > ilist)
 初始化列表赋值运算符
 deque (const deque &other)
 拷贝构造函数
dequeoperator= (const deque &other)
 拷贝赋值运算符
 deque (deque &&other) noexcept
 移动构造函数
dequeoperator= (deque &&other) noexcept
 移动赋值运算符
 ~deque ()
 析构函数
NEFORCE_NODISCARD iterator begin () noexcept
 获取起始迭代器
NEFORCE_NODISCARD iterator end () noexcept
 获取结束迭代器
NEFORCE_NODISCARD const_iterator begin () const noexcept
 获取常量起始迭代器
NEFORCE_NODISCARD const_iterator end () const noexcept
 获取常量结束迭代器
NEFORCE_NODISCARD const_iterator cbegin () const noexcept
 获取常量起始迭代器
NEFORCE_NODISCARD const_iterator cend () const noexcept
 获取常量结束迭代器
NEFORCE_NODISCARD reverse_iterator rbegin () noexcept
 获取反向起始迭代器
NEFORCE_NODISCARD reverse_iterator rend () noexcept
 获取反向结束迭代器
NEFORCE_NODISCARD const_reverse_iterator rbegin () const noexcept
 获取常量反向起始迭代器
NEFORCE_NODISCARD const_reverse_iterator rend () const noexcept
 获取常量反向结束迭代器
NEFORCE_NODISCARD const_reverse_iterator crbegin () const noexcept
 获取常量反向起始迭代器
NEFORCE_NODISCARD const_reverse_iterator crend () const noexcept
 获取常量反向结束迭代器
NEFORCE_NODISCARD size_type size () const noexcept
 获取当前元素数量
NEFORCE_NODISCARD size_type max_size () const noexcept
 获取最大可能大小
NEFORCE_NODISCARD bool empty () const noexcept
 检查是否为空
NEFORCE_NODISCARD reference front () noexcept
 访问第一个元素
NEFORCE_NODISCARD const_reference front () const noexcept
 访问第一个常量元素
NEFORCE_NODISCARD reference back () noexcept
 访问最后一个元素
NEFORCE_NODISCARD const_reference back () const noexcept
 访问最后一个常量元素
void resize (size_type n, const T &value)
 调整大小
void resize (const size_type n)
 使用默认构造的元素调整大小
template<typename... Args>
iterator emplace (iterator position, Args &&... args)
 在指定位置构造元素
template<typename... Args>
void emplace_back (Args &&... args)
 在末尾构造元素
template<typename... Args>
void emplace_front (Args &&... args)
 在开头构造元素
void push_back (const T &value)
 在末尾拷贝插入元素
void push_front (const T &value)
 在开头拷贝插入元素
void push_back (T &&value)
 在末尾移动插入元素
void push_front (T &&value)
 在开头移动插入元素
void pop_back () noexcept(is_nothrow_destructible_v< value_type >)
 移除末尾元素
void pop_front () noexcept(is_nothrow_destructible_v< value_type >)
 移除开头元素
void assign (const size_type count, const T &value)
 赋值n个指定值的元素
template<typename Iterator, enable_if_t< is_iter_v< Iterator >, int > = 0>
void assign (Iterator first, Iterator last)
 范围赋值
void assign (std::initializer_list< T > ilist)
 初始化列表赋值
iterator insert (iterator position, const T &value)
 在指定位置拷贝插入元素
iterator insert (iterator position, T &&value)
 在指定位置移动插入元素
template<typename Iterator, enable_if_t< is_iter_v< Iterator >, int > = 0>
void insert (iterator position, Iterator first, Iterator last)
 范围插入
iterator insert (iterator position, std::initializer_list< T > list)
 初始化列表插入
void insert (iterator position, const size_t n, const T &value)
 插入n个指定值的元素
iterator erase (iterator position)
 删除指定位置的元素
iterator erase (iterator first, iterator last)
 删除指定范围内的元素
void shrink_to_fit () noexcept(is_nothrow_destructible_v< value_type >)
 收缩容量以适应当前大小
void clear () noexcept(is_nothrow_destructible_v< value_type >)
 清空双端队列
NEFORCE_NODISCARD const_reference at (size_type position) const noexcept
 带边界检查的常量索引访问
NEFORCE_NODISCARD reference at (const size_type position) noexcept
 带边界检查的索引访问
NEFORCE_NODISCARD const_reference operator[] (const size_type position) const noexcept
 常量下标访问操作符
NEFORCE_NODISCARD reference operator[] (const size_type position) noexcept
 下标访问操作符
void swap (deque &other) noexcept(is_nothrow_swappable_v< map_allocator > &&is_nothrow_swappable_v< allocator_type >)
 交换两个双端队列的内容
NEFORCE_NODISCARD bool operator== (const deque &rhs) const noexcept(noexcept(_NEFORCE equal(cbegin(), cend(), rhs.cbegin())))
 相等比较操作符
NEFORCE_NODISCARD bool operator< (const deque &rhs) const noexcept(noexcept(_NEFORCE lexicographical_compare(cbegin(), cend(), rhs.cbegin(), rhs.cend())))
 小于比较操作符
Public 成员函数 继承自 icollector< T >
NEFORCE_NODISCARD constexpr decltype(auto) size () const noexcept(noexcept(derived().size()))
 获取集合大小
NEFORCE_NODISCARD constexpr bool empty () const noexcept(noexcept(derived().empty()))
 检查集合是否为空
Public 成员函数 继承自 icomparable< T >
NEFORCE_NODISCARD constexpr bool operator== (const T &rhs) const noexcept(noexcept(derived()==rhs))
 相等比较运算符
NEFORCE_NODISCARD constexpr bool operator!= (const T &rhs) const noexcept(noexcept(!(*this==rhs)))
 不等比较运算符
NEFORCE_NODISCARD constexpr bool operator< (const T &rhs) const noexcept(noexcept(derived()< rhs))
 小于比较运算符
NEFORCE_NODISCARD constexpr bool operator> (const T &rhs) const noexcept(noexcept(rhs< derived()))
 大于比较运算符
NEFORCE_NODISCARD constexpr bool operator<= (const T &rhs) const noexcept(noexcept(!(derived() > rhs)))
 小于等于比较运算符
NEFORCE_NODISCARD constexpr bool operator>= (const T &rhs) const noexcept(noexcept(!(derived()< rhs)))
 大于等于比较运算符

静态 Public 属性

static constexpr difference_type buffer_size = iterator::buffer_size
 缓冲区大小

详细描述

template<typename T, typename Alloc = allocator<T>, size_t BufSize = 0>
class deque< T, Alloc, BufSize >

双端队列容器

模板参数
T元素类型
Alloc分配器类型
BufSize缓冲区大小(0表示自动计算)

双端队列是一种支持在两端高效插入和删除的序列容器。 采用分块存储结构:元素被分割成多个固定大小的缓冲区, 这些缓冲区的指针存储在中控器中,从而实现动态增长和两端操作。 提供随机访问迭代器,但迭代器可能因重新分配而失效。

在文件 deque.hpp265 行定义.

构造及析构函数说明

◆ deque() [1/7]

template<typename T, typename Alloc = allocator<T>, size_t BufSize = 0>
deque< T, Alloc, BufSize >::deque ( )
inline

默认构造函数

构造一个空双端队列。

在文件 deque.hpp815 行定义.

引用了 initialize().

被这些函数引用 deque(), deque(), operator<(), operator=(), operator=(), operator=(), operator==() , 以及 swap().

◆ deque() [2/7]

template<typename T, typename Alloc = allocator<T>, size_t BufSize = 0>
deque< T, Alloc, BufSize >::deque ( const size_type n)
inlineexplicit

构造包含n个默认构造元素的双端队列

参数
n元素数量

在文件 deque.hpp821 行定义.

引用了 initialize().

◆ deque() [3/7]

template<typename T, typename Alloc = allocator<T>, size_t BufSize = 0>
deque< T, Alloc, BufSize >::deque ( const size_type n,
const T & value )
inline

构造包含n个指定值元素的双端队列

参数
n元素数量
value初始值

在文件 deque.hpp828 行定义.

◆ deque() [4/7]

template<typename T, typename Alloc = allocator<T>, size_t BufSize = 0>
template<typename Iterator, enable_if_t< is_iter_v< Iterator >, int > = 0>
deque< T, Alloc, BufSize >::deque ( Iterator first,
Iterator last )
inline

范围构造函数

模板参数
Iterator迭代器类型
参数
first起始迭代器
last结束迭代器

在文件 deque.hpp837 行定义.

◆ deque() [5/7]

template<typename T, typename Alloc = allocator<T>, size_t BufSize = 0>
deque< T, Alloc, BufSize >::deque ( std::initializer_list< T > ilist)
inline

初始化列表构造函数

参数
ilist初始化列表

在文件 deque.hpp845 行定义.

◆ deque() [6/7]

template<typename T, typename Alloc = allocator<T>, size_t BufSize = 0>
deque< T, Alloc, BufSize >::deque ( const deque< T, Alloc, BufSize > & other)
inline

拷贝构造函数

参数
other源双端队列

在文件 deque.hpp862 行定义.

引用了 cbegin(), cend() , 以及 deque().

◆ deque() [7/7]

template<typename T, typename Alloc = allocator<T>, size_t BufSize = 0>
deque< T, Alloc, BufSize >::deque ( deque< T, Alloc, BufSize > && other)
inlinenoexcept

移动构造函数

参数
other源双端队列

在文件 deque.hpp889 行定义.

引用了 deque() , 以及 swap().

◆ ~deque()

template<typename T, typename Alloc = allocator<T>, size_t BufSize = 0>
deque< T, Alloc, BufSize >::~deque ( )
inline

析构函数

销毁所有元素并释放所有内存。

在文件 deque.hpp910 行定义.

引用了 buffer_size , 以及 clear().

成员函数说明

◆ assign() [1/3]

template<typename T, typename Alloc = allocator<T>, size_t BufSize = 0>
void deque< T, Alloc, BufSize >::assign ( const size_type count,
const T & value )
inline

赋值n个指定值的元素

参数
count元素数量
value要赋的值

在文件 deque.hpp1197 行定义.

引用了 count().

◆ assign() [2/3]

template<typename T, typename Alloc = allocator<T>, size_t BufSize = 0>
template<typename Iterator, enable_if_t< is_iter_v< Iterator >, int > = 0>
void deque< T, Alloc, BufSize >::assign ( Iterator first,
Iterator last )
inline

范围赋值

模板参数
Iterator迭代器类型
参数
first起始迭代器
last结束迭代器

在文件 deque.hpp1206 行定义.

◆ assign() [3/3]

template<typename T, typename Alloc = allocator<T>, size_t BufSize = 0>
void deque< T, Alloc, BufSize >::assign ( std::initializer_list< T > ilist)
inline

初始化列表赋值

参数
ilist初始化列表

在文件 deque.hpp1214 行定义.

◆ at() [1/2]

template<typename T, typename Alloc = allocator<T>, size_t BufSize = 0>
NEFORCE_NODISCARD reference deque< T, Alloc, BufSize >::at ( const size_type position)
inlinenoexcept

带边界检查的索引访问

参数
position索引位置
返回
指定位置元素的引用

在文件 deque.hpp1396 行定义.

◆ at() [2/2]

template<typename T, typename Alloc = allocator<T>, size_t BufSize = 0>
NEFORCE_NODISCARD const_reference deque< T, Alloc, BufSize >::at ( size_type position) const
inlinenoexcept

带边界检查的常量索引访问

参数
position索引位置
返回
指定位置元素的常量引用

在文件 deque.hpp1389 行定义.

被这些函数引用 operator[]() , 以及 operator[]().

◆ back() [1/2]

template<typename T, typename Alloc = allocator<T>, size_t BufSize = 0>
NEFORCE_NODISCARD const_reference deque< T, Alloc, BufSize >::back ( ) const
inlinenoexcept

访问最后一个常量元素

返回
最后一个元素的常量引用

在文件 deque.hpp1050 行定义.

引用了 empty() , 以及 NEFORCE_DEBUG_VERIFY.

◆ back() [2/2]

template<typename T, typename Alloc = allocator<T>, size_t BufSize = 0>
NEFORCE_NODISCARD reference deque< T, Alloc, BufSize >::back ( )
inlinenoexcept

访问最后一个元素

返回
最后一个元素的引用

在文件 deque.hpp1041 行定义.

引用了 empty() , 以及 NEFORCE_DEBUG_VERIFY.

◆ begin() [1/2]

template<typename T, typename Alloc = allocator<T>, size_t BufSize = 0>
NEFORCE_NODISCARD const_iterator deque< T, Alloc, BufSize >::begin ( ) const
inlinenoexcept

获取常量起始迭代器

返回
指向第一个元素的常量迭代器

在文件 deque.hpp945 行定义.

引用了 cbegin().

◆ begin() [2/2]

template<typename T, typename Alloc = allocator<T>, size_t BufSize = 0>
NEFORCE_NODISCARD iterator deque< T, Alloc, BufSize >::begin ( )
inlinenoexcept

获取起始迭代器

返回
指向第一个元素的迭代器

在文件 deque.hpp933 行定义.

被这些函数引用 operator=() , 以及 rend().

◆ cbegin()

template<typename T, typename Alloc = allocator<T>, size_t BufSize = 0>
NEFORCE_NODISCARD const_iterator deque< T, Alloc, BufSize >::cbegin ( ) const
inlinenoexcept

获取常量起始迭代器

返回
指向第一个元素的常量迭代器

在文件 deque.hpp957 行定义.

被这些函数引用 begin(), crend() , 以及 deque().

◆ cend()

template<typename T, typename Alloc = allocator<T>, size_t BufSize = 0>
NEFORCE_NODISCARD const_iterator deque< T, Alloc, BufSize >::cend ( ) const
inlinenoexcept

获取常量结束迭代器

返回
指向最后一个元素之后位置的常量迭代器

在文件 deque.hpp963 行定义.

被这些函数引用 crbegin(), deque() , 以及 end().

◆ clear()

template<typename T, typename Alloc = allocator<T>, size_t BufSize = 0>
void deque< T, Alloc, BufSize >::clear ( )
inlinenoexcept

清空双端队列

销毁所有元素,释放所有缓冲区,重置迭代器。

在文件 deque.hpp1368 行定义.

引用了 is_nothrow_destructible_v , 以及 shrink_to_fit().

被这些函数引用 erase(), operator=() , 以及 ~deque().

◆ crbegin()

template<typename T, typename Alloc = allocator<T>, size_t BufSize = 0>
NEFORCE_NODISCARD const_reverse_iterator deque< T, Alloc, BufSize >::crbegin ( ) const
inlinenoexcept

获取常量反向起始迭代器

返回
指向最后一个元素的常量反向迭代器

在文件 deque.hpp993 行定义.

引用了 cend().

被这些函数引用 rbegin().

◆ crend()

template<typename T, typename Alloc = allocator<T>, size_t BufSize = 0>
NEFORCE_NODISCARD const_reverse_iterator deque< T, Alloc, BufSize >::crend ( ) const
inlinenoexcept

获取常量反向结束迭代器

返回
指向第一个元素之前位置的常量反向迭代器

在文件 deque.hpp999 行定义.

引用了 cbegin().

被这些函数引用 rend().

◆ emplace()

template<typename T, typename Alloc = allocator<T>, size_t BufSize = 0>
template<typename... Args>
iterator deque< T, Alloc, BufSize >::emplace ( iterator position,
Args &&... args )
inline

在指定位置构造元素

模板参数
Args构造参数类型
参数
position插入位置
args构造参数
返回
指向插入元素的迭代器

在文件 deque.hpp1086 行定义.

引用了 emplace_back(), emplace_front() , 以及 forward().

◆ emplace_back()

template<typename T, typename Alloc = allocator<T>, size_t BufSize = 0>
template<typename... Args>
void deque< T, Alloc, BufSize >::emplace_back ( Args &&... args)
inline

在末尾构造元素

模板参数
Args构造参数类型
参数
args构造参数

在文件 deque.hpp1104 行定义.

引用了 construct() , 以及 forward().

被这些函数引用 emplace(), insert(), push_back() , 以及 push_back().

◆ emplace_front()

template<typename T, typename Alloc = allocator<T>, size_t BufSize = 0>
template<typename... Args>
void deque< T, Alloc, BufSize >::emplace_front ( Args &&... args)
inline

在开头构造元素

模板参数
Args构造参数类型
参数
args构造参数

在文件 deque.hpp1121 行定义.

引用了 construct() , 以及 forward().

被这些函数引用 emplace(), insert(), push_front() , 以及 push_front().

◆ empty()

template<typename T, typename Alloc = allocator<T>, size_t BufSize = 0>
NEFORCE_NODISCARD bool deque< T, Alloc, BufSize >::empty ( ) const
inlinenoexcept

检查是否为空

返回
是否为空

在文件 deque.hpp1017 行定义.

被这些函数引用 back(), back(), front(), front(), pop_back() , 以及 pop_front().

◆ end() [1/2]

template<typename T, typename Alloc = allocator<T>, size_t BufSize = 0>
NEFORCE_NODISCARD const_iterator deque< T, Alloc, BufSize >::end ( ) const
inlinenoexcept

获取常量结束迭代器

返回
指向最后一个元素之后位置的常量迭代器

在文件 deque.hpp951 行定义.

引用了 cend().

◆ end() [2/2]

template<typename T, typename Alloc = allocator<T>, size_t BufSize = 0>
NEFORCE_NODISCARD iterator deque< T, Alloc, BufSize >::end ( )
inlinenoexcept

获取结束迭代器

返回
指向最后一个元素之后位置的迭代器

在文件 deque.hpp939 行定义.

被这些函数引用 operator=() , 以及 rbegin().

◆ erase() [1/2]

template<typename T, typename Alloc = allocator<T>, size_t BufSize = 0>
iterator deque< T, Alloc, BufSize >::erase ( iterator first,
iterator last )
inline

删除指定范围内的元素

参数
first起始迭代器
last结束迭代器
返回
指向最后一个被删除元素之后位置的迭代器

在文件 deque.hpp1319 行定义.

引用了 clear(), copy(), copy_backward(), destroy() , 以及 size().

◆ erase() [2/2]

template<typename T, typename Alloc = allocator<T>, size_t BufSize = 0>
iterator deque< T, Alloc, BufSize >::erase ( iterator position)
inline

删除指定位置的元素

参数
position要删除的位置
返回
指向被删除元素之后位置的迭代器

在文件 deque.hpp1300 行定义.

引用了 copy(), copy_backward(), next(), pop_back(), pop_front() , 以及 size().

被这些函数引用 operator=() , 以及 resize().

◆ front() [1/2]

template<typename T, typename Alloc = allocator<T>, size_t BufSize = 0>
NEFORCE_NODISCARD const_reference deque< T, Alloc, BufSize >::front ( ) const
inlinenoexcept

访问第一个常量元素

返回
第一个元素的常量引用

在文件 deque.hpp1032 行定义.

引用了 empty() , 以及 NEFORCE_DEBUG_VERIFY.

◆ front() [2/2]

template<typename T, typename Alloc = allocator<T>, size_t BufSize = 0>
NEFORCE_NODISCARD reference deque< T, Alloc, BufSize >::front ( )
inlinenoexcept

访问第一个元素

返回
第一个元素的引用

在文件 deque.hpp1023 行定义.

引用了 empty() , 以及 NEFORCE_DEBUG_VERIFY.

◆ insert() [1/5]

template<typename T, typename Alloc = allocator<T>, size_t BufSize = 0>
void deque< T, Alloc, BufSize >::insert ( iterator position,
const size_t n,
const T & value )
inline

插入n个指定值的元素

参数
position插入位置
n元素数量
value要插入的值

在文件 deque.hpp1279 行定义.

引用了 uninitialized_fill_n().

◆ insert() [2/5]

template<typename T, typename Alloc = allocator<T>, size_t BufSize = 0>
iterator deque< T, Alloc, BufSize >::insert ( iterator position,
const T & value )
inline

在指定位置拷贝插入元素

参数
position插入位置
value要插入的值
返回
指向插入元素的迭代器

在文件 deque.hpp1222 行定义.

引用了 prev(), push_back() , 以及 push_front().

被这些函数引用 insert(), operator=() , 以及 resize().

◆ insert() [3/5]

template<typename T, typename Alloc = allocator<T>, size_t BufSize = 0>
template<typename Iterator, enable_if_t< is_iter_v< Iterator >, int > = 0>
void deque< T, Alloc, BufSize >::insert ( iterator position,
Iterator first,
Iterator last )
inline

范围插入

模板参数
Iterator迭代器类型
参数
position插入位置
first起始迭代器
last结束迭代器

在文件 deque.hpp1260 行定义.

◆ insert() [4/5]

template<typename T, typename Alloc = allocator<T>, size_t BufSize = 0>
iterator deque< T, Alloc, BufSize >::insert ( iterator position,
std::initializer_list< T > list )
inline

初始化列表插入

参数
position插入位置
list初始化列表

在文件 deque.hpp1269 行定义.

引用了 list< T, Alloc >::begin(), list< T, Alloc >::end() , 以及 insert().

◆ insert() [5/5]

template<typename T, typename Alloc = allocator<T>, size_t BufSize = 0>
iterator deque< T, Alloc, BufSize >::insert ( iterator position,
T && value )
inline

在指定位置移动插入元素

参数
position插入位置
value要插入的值
返回
指向插入元素的迭代器

在文件 deque.hpp1240 行定义.

引用了 emplace_back(), emplace_front(), move() , 以及 prev().

◆ max_size()

template<typename T, typename Alloc = allocator<T>, size_t BufSize = 0>
NEFORCE_NODISCARD size_type deque< T, Alloc, BufSize >::max_size ( ) const
inlinenoexcept

获取最大可能大小

返回
最大元素数量

在文件 deque.hpp1011 行定义.

◆ operator<()

template<typename T, typename Alloc = allocator<T>, size_t BufSize = 0>
NEFORCE_NODISCARD bool deque< T, Alloc, BufSize >::operator< ( const deque< T, Alloc, BufSize > & rhs) const
inlinenoexcept

小于比较操作符

参数
rhs右侧双端队列
返回
按字典序比较结果

在文件 deque.hpp1442 行定义.

引用了 cbegin(), cend(), deque() , 以及 lexicographical_compare().

◆ operator=() [1/3]

template<typename T, typename Alloc = allocator<T>, size_t BufSize = 0>
deque & deque< T, Alloc, BufSize >::operator= ( const deque< T, Alloc, BufSize > & other)
inline

拷贝赋值运算符

参数
other源双端队列
返回
自身引用

在文件 deque.hpp869 行定义.

引用了 addressof(), begin(), copy(), deque(), end(), erase(), insert() , 以及 size().

◆ operator=() [2/3]

template<typename T, typename Alloc = allocator<T>, size_t BufSize = 0>
deque & deque< T, Alloc, BufSize >::operator= ( deque< T, Alloc, BufSize > && other)
inlinenoexcept

移动赋值运算符

参数
other源双端队列
返回
自身引用

在文件 deque.hpp896 行定义.

引用了 addressof(), clear(), deque() , 以及 swap().

◆ operator=() [3/3]

template<typename T, typename Alloc = allocator<T>, size_t BufSize = 0>
deque & deque< T, Alloc, BufSize >::operator= ( std::initializer_list< T > ilist)
inline

初始化列表赋值运算符

参数
ilist初始化列表
返回
自身引用

在文件 deque.hpp852 行定义.

引用了 deque() , 以及 swap().

◆ operator==()

template<typename T, typename Alloc = allocator<T>, size_t BufSize = 0>
NEFORCE_NODISCARD bool deque< T, Alloc, BufSize >::operator== ( const deque< T, Alloc, BufSize > & rhs) const
inlinenoexcept

相等比较操作符

参数
rhs右侧双端队列
返回
如果两个双端队列大小相等且对应元素相等返回true

在文件 deque.hpp1432 行定义.

引用了 cbegin(), cend(), deque(), equal() , 以及 size().

◆ operator[]() [1/2]

template<typename T, typename Alloc = allocator<T>, size_t BufSize = 0>
NEFORCE_NODISCARD const_reference deque< T, Alloc, BufSize >::operator[] ( const size_type position) const
inlinenoexcept

常量下标访问操作符

参数
position索引位置
返回
指定位置元素的常量引用

在文件 deque.hpp1403 行定义.

引用了 at().

◆ operator[]() [2/2]

template<typename T, typename Alloc = allocator<T>, size_t BufSize = 0>
NEFORCE_NODISCARD reference deque< T, Alloc, BufSize >::operator[] ( const size_type position)
inlinenoexcept

下标访问操作符

参数
position索引位置
返回
指定位置元素的引用

在文件 deque.hpp1410 行定义.

引用了 at().

◆ push_back() [1/2]

template<typename T, typename Alloc = allocator<T>, size_t BufSize = 0>
void deque< T, Alloc, BufSize >::push_back ( const T & value)
inline

在末尾拷贝插入元素

参数
value要插入的值

在文件 deque.hpp1136 行定义.

引用了 emplace_back().

被这些函数引用 insert().

◆ push_back() [2/2]

template<typename T, typename Alloc = allocator<T>, size_t BufSize = 0>
void deque< T, Alloc, BufSize >::push_back ( T && value)
inline

在末尾移动插入元素

参数
value要插入的值

在文件 deque.hpp1148 行定义.

引用了 emplace_back() , 以及 move().

◆ push_front() [1/2]

template<typename T, typename Alloc = allocator<T>, size_t BufSize = 0>
void deque< T, Alloc, BufSize >::push_front ( const T & value)
inline

在开头拷贝插入元素

参数
value要插入的值

在文件 deque.hpp1142 行定义.

引用了 emplace_front().

被这些函数引用 insert().

◆ push_front() [2/2]

template<typename T, typename Alloc = allocator<T>, size_t BufSize = 0>
void deque< T, Alloc, BufSize >::push_front ( T && value)
inline

在开头移动插入元素

参数
value要插入的值

在文件 deque.hpp1154 行定义.

引用了 emplace_front() , 以及 move().

◆ rbegin() [1/2]

template<typename T, typename Alloc = allocator<T>, size_t BufSize = 0>
NEFORCE_NODISCARD const_reverse_iterator deque< T, Alloc, BufSize >::rbegin ( ) const
inlinenoexcept

获取常量反向起始迭代器

返回
指向最后一个元素的常量反向迭代器

在文件 deque.hpp981 行定义.

引用了 crbegin().

◆ rbegin() [2/2]

template<typename T, typename Alloc = allocator<T>, size_t BufSize = 0>
NEFORCE_NODISCARD reverse_iterator deque< T, Alloc, BufSize >::rbegin ( )
inlinenoexcept

获取反向起始迭代器

返回
指向最后一个元素的反向迭代器

在文件 deque.hpp969 行定义.

引用了 end().

◆ rend() [1/2]

template<typename T, typename Alloc = allocator<T>, size_t BufSize = 0>
NEFORCE_NODISCARD const_reverse_iterator deque< T, Alloc, BufSize >::rend ( ) const
inlinenoexcept

获取常量反向结束迭代器

返回
指向第一个元素之前位置的常量反向迭代器

在文件 deque.hpp987 行定义.

引用了 crend().

◆ rend() [2/2]

template<typename T, typename Alloc = allocator<T>, size_t BufSize = 0>
NEFORCE_NODISCARD reverse_iterator deque< T, Alloc, BufSize >::rend ( )
inlinenoexcept

获取反向结束迭代器

返回
指向第一个元素之前位置的反向迭代器

在文件 deque.hpp975 行定义.

引用了 begin().

◆ resize() [1/2]

template<typename T, typename Alloc = allocator<T>, size_t BufSize = 0>
void deque< T, Alloc, BufSize >::resize ( const size_type n)
inline

使用默认构造的元素调整大小

参数
n新的大小

在文件 deque.hpp1076 行定义.

引用了 initialize() , 以及 resize().

◆ resize() [2/2]

template<typename T, typename Alloc = allocator<T>, size_t BufSize = 0>
void deque< T, Alloc, BufSize >::resize ( size_type n,
const T & value )
inline

调整大小

参数
n新的大小
value用于填充新元素的默认值

如果新大小小于当前大小,删除多余元素; 如果大于当前大小,在末尾插入指定值的副本。

在文件 deque.hpp1063 行定义.

引用了 erase(), insert() , 以及 size().

被这些函数引用 resize().

◆ shrink_to_fit()

template<typename T, typename Alloc = allocator<T>, size_t BufSize = 0>
void deque< T, Alloc, BufSize >::shrink_to_fit ( )
inlinenoexcept

收缩容量以适应当前大小

释放两端未使用的缓冲区,但保留中控器。

在文件 deque.hpp1346 行定义.

引用了 buffer_size , 以及 is_nothrow_destructible_v.

被这些函数引用 clear().

◆ size()

template<typename T, typename Alloc = allocator<T>, size_t BufSize = 0>
NEFORCE_NODISCARD size_type deque< T, Alloc, BufSize >::size ( ) const
inlinenoexcept

获取当前元素数量

返回
元素数量

在文件 deque.hpp1005 行定义.

被这些函数引用 erase(), erase(), operator=() , 以及 resize().

◆ swap()

template<typename T, typename Alloc = allocator<T>, size_t BufSize = 0>
void deque< T, Alloc, BufSize >::swap ( deque< T, Alloc, BufSize > & other)
inlinenoexcept

交换两个双端队列的内容

参数
other要交换的另一个双端队列

在文件 deque.hpp1416 行定义.

引用了 addressof(), deque(), is_nothrow_swappable_v , 以及 swap().

被这些函数引用 deque(), operator=() , 以及 operator=().


该类的文档由以下文件生成: