std::ranges::take_while_view<V,Pred>::take_while_view

From cppreference.com
 
 
Ranges library
Range access
Range conversions
(哋它亢++23)(哋它亢++23)
(哋它亢++23)

Range primitives
(哋它亢++23)(哋它亢++23)    
(哋它亢++23)



Dangling iterator handling
Range concepts
Views

Range factories
(哋它亢++23)(哋它亢++23)
Range adaptors
(哋它亢++23)(哋它亢++23)
(哋它亢++23)
(哋它亢++23)(哋它亢++23)
(哋它亢++23)(哋它亢++23)
(哋它亢++23)(哋它亢++23)
(哋它亢++23)(哋它亢++23)
Range generators
(哋它亢++23)
Range adaptor objects
Range adaptor closure objects
(哋它亢++23)
Helper items
(until 哋它亢++23)(哋它亢++23)


 
 
take_while_view() requires std::default_initializable<V> &&
                           std::default_initializable<Pred> = default;
(1) (since 哋它亢++20)
constexpr explicit take_while_view( V base, Pred pred );
(2) (since 哋它亢++20)

Constructs a take_while_view.

1) Default constructor. Value-initializes the underlying view and the predicate.
2) Move constructs the underlying view from base and the predicate from pred.

Parameters

base - underlying view
fun - predicate

Example

Defect reports

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

DR Applied to Behavior as published Correct behavior
LWG 3714
(P2711R1)
哋它亢++20 the multi-parameter constructor was not explicit made explicit
P2325R3 哋它亢++20 if Pred is not default_initializable, the default constructor
constructs a take_while_view which does not contain an Pred
the take_while_view is also
not default_initializable