本文整理汇总了C++中ranges::is_permutation方法的典型用法代码示例。如果您正苦于以下问题:C++ ranges::is_permutation方法的具体用法?C++ ranges::is_permutation怎么用?C++ ranges::is_permutation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ranges
的用法示例。
在下文中一共展示了ranges::is_permutation方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: test
void test(const bool result,
const int* first1, const int* last1,
const int* first2, const int* last2)
{
using ranges::is_permutation;
using ranges::subrange;
using I = forward_iterator<const int*>;
using S = sentinel<const int*>;
CHECK(is_permutation(I{first1}, I{last1}, I{first2}, I{last2}) == result);
CHECK(is_permutation(I{first1}, S{last1}, I{first2}, S{last2}) == result);
CHECK(is_permutation(I{first1}, I{last1}, I{first2}, I{last2}, std::equal_to<int>{}) == result);
CHECK(is_permutation(I{first1}, S{last1}, I{first2}, S{last2}, std::equal_to<int>{}) == result);
CHECK(is_permutation(subrange{I{first1}, I{last1}}, subrange{I{first2}, I{last2}}) == result);
CHECK(is_permutation(subrange{I{first1}, S{last1}}, subrange{I{first2}, S{last2}}) == result);
CHECK(is_permutation(subrange{I{first1}, I{last1}}, subrange{I{first2}, I{last2}}, std::equal_to<int>{}) == result);
CHECK(is_permutation(subrange{I{first1}, S{last1}}, subrange{I{first2}, S{last2}}, std::equal_to<int>{}) == result);
}