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::collect_fn< C > Struct Template Referencefinal

Function object implementing jh::ranges::collect. More...

#include <jh/ranges/collect.h>

Public Member Functions

template<std::ranges::range R>
constexpr auto operator() (R &&r) const
 Eagerly materialize the provided range into container type C.
constexpr auto operator() () const
 Return a closure object for pipe usage syntax.

Detailed Description

template<typename C>
struct jh::ranges::collect_fn< C >

Function object implementing jh::ranges::collect.

Provides both direct-call and pipe-style interfaces for range materialization.

Direct call form

constexpr collect_fn< C > collect
Global instance of the collect adaptor.
Definition collect.h:375

Pipe form

When the range is closable to C, this function uses jh::ranges::to_adaptor<C> internally; otherwise, it falls back to insertion/emplacement iteration.

Template Parameters
CThe target container type.
See also
jh::ranges::collect_adaptor
jh::ranges::collect

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