This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of NAD Concepts status.

1109. std::includes should require CopyConstructible predicate

Section: 27.8.7.2 [includes] Status: NAD Concepts Submitter: Alisdair Meredith Opened: 2009-04-28 Last modified: 2016-01-28

Priority: Not Prioritized

View all other issues in [includes].

View all issues with NAD Concepts status.

Discussion:

All the set operation algorithms require a CopyConstructible predicate, with the exception of std::includes. This looks like a typo as much as anything, given the general library requirement that predicates are copy constructible, and wording style of other set-like operations.

[ Batavia (2009-05): ]

We agree with the proposed resolution. Move to NAD Editorial.

Proposed resolution:

Change [algorithms.syn] and 27.8.7.2 [includes]:

template<InputIterator Iter1, InputIterator Iter2,
         typename CopyConstructible Compare>
  requires Predicate<Compare, Iter1::value_type, Iter2::value_type>
        && Predicate<Compare, Iter2::value_type, Iter1::value_type>
  bool includes(Iter1 first1, Iter1 last1,
                Iter2 first2, Iter2 last2,
                Compare comp);