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.

3447. Deduction guides for take_view and drop_view have different constraints

Section: 26.7.10.2 [range.take.view] Status: WP Submitter: Jens Maurer Opened: 2020-05-15 Last modified: 2020-11-09

Priority: 0

View all other issues in [range.take.view].

View all issues with WP status.

Discussion:

From this editorial issue request:

(Note "range R" vs "class R".)

In 26.7.10.2 [range.take.view], the deduction guide for take_view is declared as:

template<range R>
  take_view(R&&, range_difference_t<R>)
    -> take_view<views::all_t<R>>;

In 26.7.12.2 [range.drop.view], the deduction guide for drop_view is declared as:

template<class R>
  drop_view(R&&, range_difference_t<R>) -> drop_view<views::all_t<R>>;

Note the difference between their template parameter lists.

Suggested resolution:

Change the deduction guide of take_view from

template<range R>

to

template<class R>

[2020-07-17; Moved to Ready in telecon]

[2020-11-09 Approved In November virtual meeting. Status changed: Ready → WP.]

Proposed resolution:

This wording is relative to N4861.

  1. Modify 26.7.10.2 [range.take.view], class template take_view synopsis, as indicated:

    […]
    template<rangeclass R>
      take_view(R&&, range_difference_t<R>)
        -> take_view<views::all_t<R>>;
    […]