Namespaces
Variants
Views
Actions

std::ranges::transform_view<V,F>::transform_view

From cppreference.com
 
 
 
 
transform_view() = default;
(1) (since C++20)
constexpr transform_view( V base, F fun );
(2) (since C++20)

Constructs a transform_view.

1) Default constructor. Value-initializes the underlying view and the transformation function. If F is not default_initializable, the transform_view does not hold a transformation function, and subsequent use of the transformation function (e.g. dereference of iterator) is undefined behavior.
2) Move constructs the underlying view from base and the transformation function from fun.

[edit] Parameters

base - view
fun - transformation function

[edit] Example