Date
2017-07-12.01:58:24
Message id
9361

Content

Proposed resolution:

This wording is relative to N4659.

  1. Edit [list.ops] as indicated:

    -1- Since lists allow fast insertion and erasing from the middle of a list, certain operations are provided specifically for them.259) In this subclause, arguments for a template parameter named Predicate or BinaryPredicate shall meet the corresponding requirements in [algorithms.requirements]. For merge and sort, the definitions and requirements in [alg.sorting] apply.

  2. Edit [list.ops] as indicated:

    void merge(list& x);
    void merge(list&& x);
    template <class Compare> void merge(list& x, Compare comp);
    template <class Compare> void merge(list&& x, Compare comp);
    

    -22- Requires: comp shall define a strict weak ordering ([alg.sorting]), and bBoth the list and the argument list shall be sorted according to this orderingwith respect to the comparator operator< (for the first two overloads) or comp (for the last two overloads).

  3. Delete [list.ops]/28 as redundant:

    void sort();
    template <class Compare> void sort(Compare comp);
    

    -28- Requires: operator< (for the first version) or comp (for the second version) shall define a strict weak ordering ([alg.sorting]).

  4. Insert a new paragraph at the beginning of [forwardlist.ops]:

    -?- In this subclause, arguments for a template parameter named Predicate or BinaryPredicate shall meet the corresponding requirements in [algorithms.requirements]. For merge and sort, the definitions and requirements in [alg.sorting] apply.

    void splice_after(const_iterator position, forward_list& x);
    void splice_after(const_iterator position, forward_list&& x);
    

    […]

  5. Edit [forwardlist.ops] as indicated:

    void merge(forward_list& x);
    void merge(forward_list&& x);
    template <class Compare> void merge(forward_list& x, Compare comp);
    template <class Compare> void merge(forward_list&& x, Compare comp);
    

    -22- Requires: comp defines a strict weak ordering ([alg.sorting]), and *this and x are both sorted according to this orderingwith respect to the comparator operator< (for the first two overloads) or comp (for the last two overloads). get_allocator() == x.get_allocator().

  6. Delete [forwardlist.ops]/23 as redundant:

    void sort();
    template <class Compare> void sort(Compare comp);
    

    -23- Requires: operator< (for the version with no arguments) or comp (for the version with a comparison argument) defines a strict weak ordering ([alg.sorting]).