|
MSTL 1.4.0
A Modern C++ Library with extended functionality, web components, and utility libraries
|
临时缓冲区类 更多...
#include <temporary_buffer.hpp>
Public 类型 | |
| using | value_type = iter_value_t<Iterator> |
| 元素类型 | |
| using | pointer = value_type* |
| 指针类型 | |
| using | const_pointer = const value_type* |
| 常量指针类型 | |
| using | reference = value_type& |
| 引用类型 | |
| using | const_reference = const value_type& |
| 常量引用类型 | |
| using | size_type = size_t |
| 大小类型 | |
| using | difference_type = ptrdiff_t |
| 差异类型 | |
| using | allocator_type = standard_allocator<value_type> |
| 分配器类型 | |
Public 成员函数 | |
| temporary_buffer (const temporary_buffer &)=delete | |
| 禁止复制构造 | |
| void | operator= (const temporary_buffer &)=delete |
| 禁止复制赋值 | |
| MSTL_CONSTEXPR20 | temporary_buffer (Iterator first, Iterator last) |
| 构造函数 | |
| MSTL_CONSTEXPR20 | ~temporary_buffer () |
| 析构函数 | |
| MSTL_NODISCARD MSTL_CONSTEXPR20 size_type | size () const noexcept |
| 获取缓冲区实际大小 | |
| MSTL_NODISCARD MSTL_CONSTEXPR20 size_type | requested_size () const noexcept |
| 获取请求的缓冲区大小 | |
| MSTL_NODISCARD MSTL_CONSTEXPR20 pointer | begin () noexcept |
| 获取缓冲区起始迭代器 | |
| MSTL_NODISCARD MSTL_CONSTEXPR20 pointer | end () noexcept |
| 获取缓冲区结束迭代器 | |
| MSTL_NODISCARD MSTL_CONSTEXPR20 const_pointer | cbegin () const noexcept |
| 获取常量缓冲区起始迭代器 | |
| MSTL_NODISCARD MSTL_CONSTEXPR20 const_pointer | cend () const noexcept |
| 获取常量缓冲区结束迭代器 | |
| MSTL_NODISCARD MSTL_CONSTEXPR20 bool | empty () const noexcept |
| 检查缓冲区是否为空 | |
临时缓冲区类
| Iterator | 迭代器类型 |
管理临时内存缓冲区的RAII包装器,用于算法中需要临时存储的场景。 自动管理内存分配和释放,确保异常安全。
在文件 temporary_buffer.hpp 第 32 行定义.
|
inline |
构造函数
| first | 范围起始迭代器 |
| last | 范围结束迭代器 |
根据迭代器范围计算缓冲区大小,分配内存并初始化。 如果分配失败或初始化失败,抛出memory_exception异常,但保证不会泄漏内存。
| allocate_exception | 如果内存分配失败 |
| memory_exception | 当值类型为非平凡类型时,如果构造过程中发生异常 |
在文件 temporary_buffer.hpp 第 111 行定义.
引用了 _MSTL, standard_allocator< value_type >::deallocate() , 以及 distance().
|
inline |
析构函数
销毁缓冲区中的对象并释放内存。
在文件 temporary_buffer.hpp 第 129 行定义.
引用了 _MSTL, standard_allocator< value_type >::deallocate() , 以及 destroy().
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |