|
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.
|
Lightweight adapter that exposes any sequence as a standard range. More...
#include <jh/ranges/range_adaptor.h>
Public Member Functions | |
| range_adaptor (Seq &&s) | |
| auto | begin () noexcept(noexcept(get().begin())) |
| auto | end () noexcept(noexcept(get().end())) |
Lightweight adapter that exposes any sequence as a standard range.
Wraps a duck-typed sequence so that it models std::ranges::range.
begin() returns a completed_iterator wrapping the sequence's iterator. end() is forwarded directly from the underlying sequence. Enables generic algorithms and range-based for loops to work with any object satisfying jh::concepts::sequence, regardless of whether it defines STL-compatible iterator traits.
| Seq | Sequence-like type satisfying jh::concepts::sequence. |
begin() and end() types are identical, the adaptor transparently returns a completed_iterator for both. This allows the resulting view to model std::ranges::common_range, enabling tighter interoperability with standard range algorithms.