Skip to content

Why do deduction guides for take_view and drop_view have different constraints? LWG 3447 #3997

@cpplearner

Description

@cpplearner

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

AFAIK there's no difference in effect, because views::all_t only accepts a viewable_range.

Can they be declared in a more similar way?

Metadata

Metadata

Assignees

No one assigned

    Labels

    lwgIssue must be reviewed by LWG.not-editorialIssue is not deemed editorial; the editorial issue is kept open for tracking.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions