deduction guides for std::ranges::take_view

From cppreference.com
< cpp‎ | ranges‎ | take view
 
 
Ranges library
Range access
Range conversions
(C++23)
Range primitives



Dangling iterator handling
Range concepts
Views

Range factories
Range adaptors
Range generators
Range adaptor objects
Range adaptor closure objects
Helper items
(until C++23)(C++23)


 
 
Defined in header <ranges>
template< class R >
take_view( R&&, ranges::range_difference_t<R> ) -> take_view<views::all_t<R>>;
(since C++20)

The deduction guide is provided for std::ranges::take_view to allow deduction from range and number of elements.

Example

Defect Reports

The following behavior-changing defect reports were applied retroactively to previously published C++ standards.

DR Applied to Behavior as published Correct behavior
LWG 3447 C++20 the template parameter R is constrained with range R is unconstrained
(but range_difference_t requires range)