Title
match_results should be moveable
Status
c++11
Section
[re.results.const]
Submitter
Stephan T. Lavavej

Created on 2009-09-15.00:00:00 last changed 154 months ago

Messages

Date: 2010-10-21.18:28:33

Proposed resolution:

  1. Add the following member declarations to [re.results]/3:

    // 28.10.1, construct/copy/destroy:
    explicit match_results(const Allocator& a = Allocator());
    match_results(const match_results& m);
    match_results(match_results&& m);
    match_results& operator=(const match_results& m);
    match_results& operator=(match_results&& m);
    ~match_results();
    
  2. Add the following new prototype descriptions to [re.results.const] using the table numbering of N3000 (referring to the table titled "match_results assignment operator effects"):

    match_results(const match_results& m);
    

    4 Effects: Constructs an object of class match_results, as a copy of m.

    match_results(match_results&& m);
    

    5 Effects: Move-constructs an object of class match_results from m satisfying the same postconditions as Table 131. Additionally the stored Allocator value is move constructed from m.get_allocator(). After the initialization of *this sets m to an unspecified but valid state.

    6 Throws: Nothing if the allocator's move constructor throws nothing.

    match_results& operator=(const match_results& m);
    

    7 Effects: Assigns m to *this. The postconditions of this function are indicated in Table 131.

    match_results& operator=(match_results&& m);
    

    8 Effects: Move-assigns m to *this. The postconditions of this function are indicated in Table 131. After the assignment, m is in a valid but unspecified state.

    9 Throws: Nothing.

Date: 2009-11-18.00:00:00

[ 2009-11-18: Moved to Tentatively Ready after 5 positive votes on c++std-lib. ]

Date: 2009-09-21.00:00:00

[ 2009-09-21 Daniel provided wording. ]

Date: 2009-09-15.00:00:00

In Working Draft N2914, match_results lacks a move constructor and move assignment operator. Because it owns dynamically allocated memory, it should be moveable.

As far as I can tell, this isn't tracked by an active issue yet; Library Issue 723 doesn't talk about match_results.

History
Date User Action Args
2011-08-23 20:07:26adminsetstatus: wp -> c++11
2010-10-21 18:28:33adminsetmessages: + msg1161
2010-10-21 18:28:33adminsetmessages: + msg1160
2010-10-21 18:28:33adminsetmessages: + msg1159
2009-09-15 00:00:00admincreate