首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

BinaryPredicate

概念BinaryPredicate是由用户提供的参数中的一些标准库工具所期望的一组需求。

给出BinaryPredicatebin_pred和一对迭代器iter1iter2或者迭代器iter和价值value,表达bin_pred(*iter1, *iter2)或者,分别,bin_pred(*iter, value),一定是上下文可转换到bool...

此外,该表达式的计算不允许调用取消引用的迭代器的非Const成员函数。

所需

  • Predicate
  • CopyConstructible%28,除非另有指明,%29

标准库

以下标准库设施期望BinaryPredicate是%27T aCompare类型。

unique

removes consecutive duplicate elements (public member function of std::forward_list)

unique

removes consecutive duplicate elements (public member function of std::list)

find_end

finds the last sequence of elements in a certain range (function template)

find_first_of

searches for any one of a set of elements (function template)

adjacent_find

finds the first two adjacent items that are equal (or satisfy a given predicate) (function template)

mismatch

finds the first position where two ranges differ (function template)

equal

determines if two sets of elements are the same (function template)

is_permutation (C++11)

determines if a sequence is a permutation of another sequence (function template)

search

searches for a range of elements (function template)

search_n

searches for a number consecutive copies of an element in a range (function template)

unique

removes consecutive duplicate elements in a range (function template)

unique_copy

creates a copy of some range of elements that contains no consecutive duplicates (function template)

not2 (deprecated)

constructs custom std::binary_negate object (function template)

unordered_set (since C++11)

collection of unique keys, hashed by keys (class template)

unordered_map (since C++11)

collection of key-value pairs, hashed by keys, keys are unique (class template)

unordered_multiset (since C++11)

collection of keys, hashed by keys (class template)

unordered_multimap (since C++11)

collection of key-value pairs, hashed by keys (class template)

代码语言:txt
复制
 ? cppreference.com

在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。

扫码关注腾讯云开发者

领取腾讯云代金券

http://www.vxiaotou.com