NexusForce 1.0.0
A Modern C++ Library with extended functionality, web components, and utility libraries
载入中...
搜索中...
未找到
模式匹配算法

在范围内查找子序列的算法 更多...

模式匹配算法 的协作图:

函数

template<typename Iterator1, typename Iterator2, typename BinaryPredicate>
constexpr Iterator1 search (Iterator1 first1, Iterator1 last1, Iterator2 first2, Iterator2 last2, BinaryPredicate binary_pred)
 在范围内查找子序列的第一次出现
template<typename Iterator1, typename Iterator2>
constexpr Iterator1 search (Iterator1 first1, Iterator1 last1, Iterator2 first2, Iterator2 last2)
 search的默认比较版本
template<typename Iterator, typename T>
constexpr Iterator search_n (Iterator first, Iterator last, const size_t count, const T &value)
 查找范围内连续n个等于指定值的子序列
template<typename Iterator, typename T, typename BinaryPredicate>
constexpr Iterator search_n (Iterator first, Iterator last, const size_t count, const T &value, BinaryPredicate binary_pred)
 search_n的谓词版本
template<typename Iterator1, typename Iterator2>
constexpr Iterator1 find_end (Iterator1 first1, Iterator1 last1, Iterator2 first2, Iterator2 last2)
 在范围内查找子序列的最后一次出现
template<typename Iterator1, typename Iterator2, typename BinaryPredicate>
constexpr Iterator1 find_first_of (Iterator1 first1, Iterator1 last1, Iterator2 first2, Iterator2 last2, BinaryPredicate comp)
 查找范围内第一个出现在指定集合中的元素
template<typename Iterator1, typename Iterator2>
constexpr Iterator1 find_first_of (Iterator1 first1, Iterator1 last1, Iterator2 first2, Iterator2 last2)
 find_first_of的默认比较版本

详细描述

在范围内查找子序列的算法

函数说明

◆ find_end()

template<typename Iterator1, typename Iterator2>
Iterator1 find_end ( Iterator1 first1,
Iterator1 last1,
Iterator2 first2,
Iterator2 last2 )
constexpr

在范围内查找子序列的最后一次出现

模板参数
Iterator1主序列迭代器类型,需要满足前向迭代器要求
Iterator2子序列迭代器类型,需要满足前向迭代器要求
参数
first1主序列起始迭代器
last1主序列终止迭代器
first2子序列起始迭代器
last2子序列终止迭代器
返回
指向子序列最后一次出现位置的迭代器,或last1如果未找到

在文件 search.hpp659 行定义.

引用了 advance(), distance(), is_ranges_bid_iter_v, is_ranges_fwd_iter_v , 以及 search().

◆ find_first_of() [1/2]

template<typename Iterator1, typename Iterator2>
Iterator1 find_first_of ( Iterator1 first1,
Iterator1 last1,
Iterator2 first2,
Iterator2 last2 )
constexpr

find_first_of的默认比较版本

模板参数
Iterator1主序列迭代器类型
Iterator2集合序列迭代器类型
参数
first1主序列起始迭代器
last1主序列终止迭代器
first2集合序列起始迭代器
last2集合序列终止迭代器
返回
指向第一个出现在集合中的元素的迭代器,或last1如果未找到

在文件 search.hpp737 行定义.

引用了 find_first_of().

◆ find_first_of() [2/2]

template<typename Iterator1, typename Iterator2, typename BinaryPredicate>
Iterator1 find_first_of ( Iterator1 first1,
Iterator1 last1,
Iterator2 first2,
Iterator2 last2,
BinaryPredicate comp )
constexpr

查找范围内第一个出现在指定集合中的元素

模板参数
Iterator1主序列迭代器类型,需要满足输入迭代器要求
Iterator2集合序列迭代器类型,需要满足输入迭代器要求
BinaryPredicate二元谓词函数类型
参数
first1主序列起始迭代器
last1主序列终止迭代器
first2集合序列起始迭代器
last2集合序列终止迭代器
comp二元谓词函数
返回
指向第一个出现在集合中的元素的迭代器,或last1如果未找到

在文件 search.hpp711 行定义.

引用了 is_ranges_input_iter_v.

被这些函数引用 find_first_of().

◆ search() [1/2]

template<typename Iterator1, typename Iterator2>
Iterator1 search ( Iterator1 first1,
Iterator1 last1,
Iterator2 first2,
Iterator2 last2 )
constexpr

search的默认比较版本

模板参数
Iterator1主序列迭代器类型
Iterator2子序列迭代器类型
参数
first1主序列起始迭代器
last1主序列终止迭代器
first2子序列起始迭代器
last2子序列终止迭代器
返回
指向子序列第一次出现位置的迭代器,或last1如果未找到

在文件 search.hpp525 行定义.

引用了 search().

◆ search() [2/2]

template<typename Iterator1, typename Iterator2, typename BinaryPredicate>
Iterator1 search ( Iterator1 first1,
Iterator1 last1,
Iterator2 first2,
Iterator2 last2,
BinaryPredicate binary_pred )
constexpr

在范围内查找子序列的第一次出现

模板参数
Iterator1主序列迭代器类型,需要满足前向迭代器要求
Iterator2子序列迭代器类型,需要满足前向迭代器要求
BinaryPredicate二元谓词函数类型
参数
first1主序列起始迭代器
last1主序列终止迭代器
first2子序列起始迭代器
last2子序列终止迭代器
binary_pred二元谓词函数
返回
指向子序列第一次出现位置的迭代器,或last1如果未找到

在文件 search.hpp482 行定义.

引用了 distance() , 以及 is_ranges_fwd_iter_v.

被这些函数引用 find_end() , 以及 search().

◆ search_n() [1/2]

template<typename Iterator, typename T>
Iterator search_n ( Iterator first,
Iterator last,
const size_t count,
const T & value )
constexpr

查找范围内连续n个等于指定值的子序列

模板参数
Iterator迭代器类型,需要满足前向迭代器要求
T值类型
参数
first范围的起始迭代器
last范围的终止迭代器
count连续出现的次数
value要查找的值
返回
指向连续n个value的子序列起始位置的迭代器,或last如果未找到

在文件 search.hpp540 行定义.

引用了 count(), find() , 以及 is_ranges_fwd_iter_v.

◆ search_n() [2/2]

template<typename Iterator, typename T, typename BinaryPredicate>
Iterator search_n ( Iterator first,
Iterator last,
const size_t count,
const T & value,
BinaryPredicate binary_pred )
constexpr

search_n的谓词版本

模板参数
Iterator迭代器类型,需要满足前向迭代器要求
T值类型
BinaryPredicate二元谓词函数类型
参数
first范围的起始迭代器
last范围的终止迭代器
count连续出现的次数
value要查找的值
binary_pred二元谓词函数
返回
指向连续n个满足谓词的子序列起始位置的迭代器,或last如果未找到

在文件 search.hpp574 行定义.

引用了 count() , 以及 is_ranges_fwd_iter_v.