Formatting move-only iterators take two
Casey Carter

Created on 2021-06-08.00:00:00 last changed 7 days ago


Date: 2021-10-14.09:56:08

Proposed resolution:

This wording is relative to N4885.

  1. Modify [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);

Date: 2021-10-14.00:00:00

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

Date: 2021-06-15.00:00:00

[ 2021-06-23; Reflector poll ]

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

Date: 2021-06-08.00:00:00

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, [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.

Date User Action Args
2021-10-14 09:56:08adminsetmessages: + msg12130
2021-10-14 09:56:08adminsetstatus: voting -> wp
2021-09-29 12:57:28adminsetstatus: ready -> voting
2021-06-23 14:16:45adminsetmessages: + msg11963
2021-06-23 14:16:45adminsetstatus: new -> ready
2021-06-12 13:17:17adminsetmessages: + msg11922
2021-06-08 00:00:00admincreate