JH-Toolkit v1.4.1
An engineering-oriented C++20 toolkit with duck-typed concepts, static design, async coroutines, and semantic containers — header-only, RTTI-free, and concurrency-friendly.
Loading...
Searching...
No Matches
jh::ranges::vis_transform_view< R, F > Class Template Referencefinal

A non-consuming transform view preserving reentrancy. More...

#include <jh/ranges/vis_transform_view.h>

Inheritance diagram for jh::ranges::vis_transform_view< R, F >:

Classes

struct  iterator
 Iterator type implementing the transformation projection. More...

Public Types

using traits = jh::concepts::range_storage_traits<R, false>

Public Member Functions

 vis_transform_view (R &&base, F func)
 Construct a vis_transform_view over a base range and callable.
constexpr auto begin () const
 Obtain a constant iterator to the beginning of the transformed range.
constexpr auto end () const
 Obtain a constant sentinel or iterator to the end of the range.
constexpr auto begin ()
constexpr auto end ()

Public Attributes

traits::stored_t base_
func_

Detailed Description

template<std::ranges::range R, typename F>
requires jh::concepts::vis_function_for<F, R>
class jh::ranges::vis_transform_view< R, F >

A non-consuming transform view preserving reentrancy.

Template Parameters
RThe underlying range type.
FThe callable transformation type.

This view wraps a base range and lazily applies a callable to each element. Unlike std::ranges::transform_view, it does not consume the range. The resulting iteration can be repeated safely, provided the base range itself is reentrant.

Constructor & Destructor Documentation

◆ vis_transform_view()

template<std::ranges::range R, typename F>
jh::ranges::vis_transform_view< R, F >::vis_transform_view ( R && base,
F func )
inline

Construct a vis_transform_view over a base range and callable.

Parameters
baseThe input range.
funcThe transformation function.

The documentation for this class was generated from the following file: