2123. merge() allocator requirements for lists versus forward lists

Section: 26.3.9.6 [forwardlist.ops] Status: C++14 Submitter: Nicolai Josuttis Opened: 2012-01-15 Last modified: 2016-02-10

Priority: Not Prioritized

View all other issues in [forwardlist.ops].

View all issues with C++14 status.

Discussion:

Sub-clause 26.3.10.5 [list.ops], p24 states for lists:

The behavior is undefined if this->get_allocator() != x.get_allocator().

But there is nothing like that for forward lists in 26.3.9.6 [forwardlist.ops], although I would expect the same undefined behavior there.

[2012, Kona]

Move to Ready.

[2012, Portland: applied to WP]

Proposed resolution:

This wording is relative to the FDIS.

  1. Add a new paragraph after 26.3.9.6 [forwardlist.ops] p19 as indicated:

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

    […]

    -19- Effects: […]

    -?- Remarks: The behavior is undefined if this->get_allocator() != x.get_allocator().