|
NexusForce 1.0.0
A rigorously engineered full-stack C++ backend library.
|
迭代器操作函数的实现 更多...
函数 | |
| template<typename Iterator> | |
| constexpr iter_pointer_t< Iterator > | neforce::to_pointer (Iterator iter) |
| 将迭代器转换为原始指针 | |
| template<typename Iterator, typename Distance> | |
| constexpr void | neforce::advance (Iterator &i, Distance n) |
| 将迭代器前进指定距离 | |
| template<typename Iterator> | |
| constexpr Iterator | neforce::prev (Iterator iter, iter_difference_t< Iterator > n=1) |
| 获取迭代器的前一个位置 | |
| template<typename Iterator> | |
| constexpr Iterator | neforce::next (Iterator iter, iter_difference_t< Iterator > n=1) |
| 获取迭代器的后一个位置 | |
| template<typename Iterator> | |
| constexpr iter_difference_t< Iterator > | neforce::distance (Iterator first, Iterator last) |
| 计算两个迭代器之间的距离 | |
迭代器操作函数的实现
|
constexpr |
将迭代器前进指定距离
| Iterator | 迭代器类型 |
| Distance | 距离类型 |
| i | 迭代器引用 |
| n | 前进距离 |
根据迭代器类型使用不同的前进策略:
在文件 iterator.hpp 第 106 行定义.
引用了 advance(), is_arithmetic_v, is_bid_iter_v, is_iter_v, is_rnd_iter_v , 以及 is_signed_v.
被这些函数引用 advance(), find_end(), lower_bound(), next(), prev() , 以及 upper_bound().
|
constexpr |
计算两个迭代器之间的距离
| Iterator | 迭代器类型 |
| first | 起始迭代器 |
| last | 结束迭代器 |
根据迭代器类型使用不同的计算策略:
在文件 iterator.hpp 第 201 行定义.
引用了 distance(), is_iter_v , 以及 is_ranges_rnd_iter_v.
被这些函数引用 neforce::basic_string< char >::append(), neforce::basic_string_view< typename Traits::char_type, Traits >::basic_string_view(), neforce::lz4_compressor::compress(), neforce::zlib_compressor::compress(), neforce::rb_tree< Key, pair< const Key, T >, select1st< pair< const Key, T > >, Compare, Alloc >::count(), neforce::lz4_compressor::decompress(), neforce::zlib_compressor::decompress(), distance(), neforce::rb_tree< Key, pair< const Key, T >, select1st< pair< const Key, T > >, Compare, Alloc >::erase(), neforce::vector< Value, Alloc >::erase(), neforce::memory_view< char >::explicit(), find_end(), inplace_merge(), neforce::basic_string< char >::insert(), neforce::bitmap::insert(), neforce::flat_hashtable< pair< Key, T >, Key, HashFcn, select1st< pair< Key, T > >, EqualKey, Alloc >::insert_equal(), neforce::flat_hashtable< pair< Key, T >, Key, HashFcn, select1st< pair< Key, T > >, EqualKey, Alloc >::insert_unique(), lower_bound(), make_leonardo_heap(), merge_sort(), pop_leonardo_heap(), push_leonardo_heap(), reduce(), rotate(), search(), neforce::file::seek(), shell_sort(), shift_left(), shift_right(), shuffle(), sort_leonardo_heap(), neforce::temporary_buffer< Iterator >::temporary_buffer(), tim_sort(), transform_reduce() , 以及 upper_bound().
|
constexpr |
获取迭代器的后一个位置
| Iterator | 迭代器类型 |
| iter | 当前迭代器 |
| n | 前进距离,默认为1 |
将迭代器前进n个位置,n必须为非负数。
在文件 iterator.hpp 第 157 行定义.
被这些函数引用 adjacent_find(), bubble_sort(), neforce::hashtable< pair< const Key, T >, Key, HashFcn, select1st< pair< const Key, T > >, EqualKey, Alloc >::clear(), neforce::retire_list::clear(), neforce::tui::screen::clear(), cocktail_sort(), neforce::deque< T, Alloc, BufSize >::erase(), neforce::flat_hashtable< pair< Key, T >, Key, HashFcn, select1st< pair< Key, T > >, EqualKey, Alloc >::erase(), neforce::hashtable< pair< const Key, T >, Key, HashFcn, select1st< pair< const Key, T > >, EqualKey, Alloc >::erase(), neforce::http::http_filter_chain::execute_post_filters_async(), neforce::http::http_filter_chain::execute_pre_filters_async(), neforce::list< pair< Key, Value > >::insert(), neforce::list< pair< Key, Value > >::insert(), is_sorted(), is_sorted_until(), minmax_element(), next(), neforce::http::async_filter::post_filter_async(), neforce::http::async_filter::pre_filter_async(), reduce(), neforce::hashtable< pair< const Key, T >, Key, HashFcn, select1st< pair< const Key, T > >, EqualKey, Alloc >::rehash(), rotate(), shift_left(), shift_right(), shuffle(), shuffle(), tim_sort(), transform_reduce(), neforce::list< pair< Key, Value > >::unique_if(), neforce::vector< Value, Alloc >::vector(), neforce::hazard_pointer_domain::~hazard_pointer_domain() , 以及 neforce::lock_free_queue< T >::~lock_free_queue().
|
constexpr |
获取迭代器的前一个位置
| Iterator | 迭代器类型 |
| iter | 当前迭代器 |
| n | 后退距离,默认为1 |
将迭代器后退n个位置,n必须为非负数。
在文件 iterator.hpp 第 141 行定义.
被这些函数引用 neforce::tui::screen::clear(), cocktail_sort(), cube_root(), neforce::hashtable< pair< const Key, T >, Key, HashFcn, select1st< pair< const Key, T > >, EqualKey, Alloc >::erase(), neforce::deque< T, Alloc, BufSize >::insert(), neforce::deque< T, Alloc, BufSize >::insert(), prev(), neforce::list< pair< Key, Value > >::sort_if(), square_root(), neforce::tui::screen::to_string() , 以及 neforce::lock_free_queue< T >::~lock_free_queue().
|
constexpr |
将迭代器转换为原始指针
| Iterator | 迭代器类型 |
| iter | 迭代器 |
在文件 iterator.hpp 第 47 行定义.
引用了 is_pointer_v , 以及 to_pointer().
被这些函数引用 to_pointer().