Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      C++ named requirements:BinaryPredicate

      From cppreference.com
      <cpp‎ |named req
       
       
      C++ named requirements
       

      BinaryPredicate is a set of requirements expected by some of the standard library facilities from the user-provided arguments.

      Given aBinaryPredicatebin_pred and a pair of iteratorsiter1 anditer2 or an iteratoriter and a (possiblyconst) valuevalue, the type and value category of the expressionbin_pred(*iter1,*iter2) or, respectively,bin_pred(*iter, value), must meet theBooleanTestable requirements.

      In addition, evaluation of that expression is not allowed to call non-const member functions of the dereferenced iterators; syntactically, the predicate must acceptconst object arguments, with the same behavior regardless of whether its arguments areconst or non-const.

      [edit]Requirements

      [edit]Standard library

      The following standard library facilities expect aBinaryPredicate which isn't aCompare type.

      removes consecutive duplicate elements
      (public member function ofstd::forward_list<T,Allocator>)[edit]
      removes consecutive duplicate elements
      (public member function ofstd::list<T,Allocator>)[edit]
      finds the last sequence of elements in a certain range
      (function template)[edit]
      searches for any one of a set of elements
      (function template)[edit]
      finds the first two adjacent items that are equal (or satisfy a given predicate)
      (function template)[edit]
      finds the first position where two ranges differ
      (function template)[edit]
      determines if two sets of elements are the same
      (function template)[edit]
      determines if a sequence is a permutation of another sequence
      (function template)[edit]
      searches for the first occurrence of a range of elements
      (function template)[edit]
      searches for the first occurrence of a number consecutive copies of an element in a range
      (function template)[edit]
      removes consecutive duplicate elements in a range
      (function template)[edit]
      creates a copy of some range of elements that contains no consecutive duplicates
      (function template)[edit]
      (deprecated in C++17)(removed in C++20)
      constructs customstd::binary_negate object
      (function template)[edit]
      collection of unique keys, hashed by keys
      (class template)[edit]
      collection of key-value pairs, hashed by keys, keys are unique
      (class template)[edit]
      collection of keys, hashed by keys
      (class template)[edit]
      collection of key-value pairs, hashed by keys
      (class template)[edit]

      [edit]Defect reports

      The following behavior-changing defect reports were applied retroactively to previously published C++ standards.

      DRApplied toBehavior as publishedCorrect behavior
      LWG 2114
      (P2167R3)
      C++98convertibility of return types tobool was too weak
      to reflect the expectation of implementations
      requirements strengthened
      LWG 3031C++98requirements onconst values were insufficentrequirements strengthened
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/named_req/BinaryPredicate&oldid=175937"

      [8]ページ先頭

      ©2009-2025 Movatter.jp