|
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.
|
Trait defining how a range (or equivalent) is held inside a view or wrapper. More...
#include <jh/conceptual/range_traits.h>
Public Types | |
| using | stored_t |
| Type used internally to hold the source, based on reference category and policy. | |
Static Public Member Functions | |
| static constexpr auto | wrap (R &&v) noexcept(std::is_nothrow_constructible_v< stored_t, R && >) |
| Wraps a range/view/sequence according to the defined storage policy. | |
| static constexpr decltype(auto) | get (stored_t &v) noexcept |
| Retrieves a reference to the underlying source. | |
| static constexpr decltype(auto) | get (const stored_t &v) noexcept |
| Retrieves a reference to the underlying source. | |
Static Public Attributes | |
| static constexpr bool | is_lvalue = std::is_lvalue_reference_v<R> |
| Indicates whether the source is an lvalue reference. | |
Trait defining how a range (or equivalent) is held inside a view or wrapper.
range_storage_traits<R> defines the storage model for wrapper-based view types that internally hold another range, view, or sequence — for example: jh::ranges::range_adaptor and jh::ranges::vis_transform_view.
std::reference_wrapper for safety. This trait allows range-holding views to remain agnostic to the lifetime and category of their sources, achieving consistent forwarding semantics across the entire jh::ranges ecosystem.
| R | Source range type to be stored. |
| UseRefWrapper | Whether lvalues should be stored as std::reference_wrapper. |
| using jh::concepts::range_storage_traits< R, UseRefWrapper >::stored_t |
Type used internally to hold the source, based on reference category and policy.
|
inlinestaticconstexprnoexcept |
Retrieves a reference to the underlying source.
| v | Stored instance. |
|
inlinestaticconstexprnoexcept |
Retrieves a reference to the underlying source.
| v | Stored instance. |
|
inlinestaticconstexprnoexcept |
Wraps a range/view/sequence according to the defined storage policy.
| v | The source range to wrap. |