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

3567. Formatting move-only iterators take two

Section: 20.20.6.4 [format.context] Status: WP Submitter: Casey Carter Opened: 2021-06-08 Last modified: 2021-10-17

Priority: Not Prioritized

View all issues with WP status.

Discussion:

LWG 3539 fixed copies of potentially-move-only iterators in the format_to and vformat_to overloads, but missed the fact that member functions of basic_format_context are specified to copy iterators as well. In particular, 20.20.6.4 [format.context] states:

iterator out();

-7- Returns: out_.

void advance_to(iterator it);

-8- Effects: Equivalent to: out_ = it;

both of which appear to require copyability.

[2021-06-23; Reflector poll]

Set status to Tentatively Ready after six votes in favour during reflector poll.

[2021-10-14 Approved at October 2021 virtual plenary. Status changed: Voting → WP.]

Proposed resolution:

This wording is relative to N4885.

  1. Modify 20.20.6.4 [format.context] as indicated:

    iterator out();
    

    -7- Returns: out_.Effects: Equivalent to: return std::move(out_);

    void advance_to(iterator it);
    

    -8- Effects: Equivalent to: out_ = std::move(it);