std::ranges::views::concat, std::ranges::concat_view
| Defined in header <ranges>
|
||
| template< ranges::input_range... Views > requires (ranges::view<Views> && ...) && (sizeof...(Views) > 0) && |
(1) | (since C++26) |
| namespace views { inline constexpr /* unspecified */ concat = /* unspecified */; |
(2) | (since C++26) |
| Call signature |
||
| template< ranges::viewable_range... Rs > requires /* see below */ |
(since C++26) | |
| Helper type aliases |
||
template< class... Rs > using /*concat-reference-t*/ = |
(3) | (exposition only*) |
template< class... Rs > using /*concat-value-t*/ = std::common_type_t<ranges::range_value_t<Rs>...>; |
(4) | (exposition only*) |
template< class... Rs > using /*concat-rvalue-reference-t*/ = |
(5) | (exposition only*) |
| Helper concepts |
||
template< class Ref, class RRef, class It > concept /*concat-indirectly-readable-impl*/ = /* see description */; |
(6) | (exposition only*) |
template< class... Rs > concept /*concatable*/ = /* see description */; |
(7) | (exposition only*) |
concat_view presents a view factory that takes an arbitrary number of ranges as an argument list, and provides a view that starts at the first element of the first range, ends at the last element of the last range, with all range elements sequenced in between respectively in the order given in the arguments, effectively concatenating, or chaining together the argument ranges.
views each of which models at least input_range and is concatable (7).views::concat is a customization point object.
Given a pack of subexpressions exprs, the expression views::concat(exprs...) is expression-equivalent to
- views::all(exprs...) if exprs is a pack with only one element whose type models
input_range, - concat_view(exprs...) otherwise.
iterator::value_type that additionally respects the underlying ranges’ value_type to support the cases when the underlying ranges have proxy iterators.iter_move.indirectly-readable concept for the iterator so that concat_view can model input_range.template< class... Rs > concept /*concat-indirectly-readable*/ = // exposition only std::common_reference_with</*concat-reference-t*/<Rs...>&&, /*concat-value-t*/<Rs...>&> && std::common_reference_with</*concat-reference-t*/<Rs...>&&, /*concat-rvalue-reference-t*/<Rs...>&&> && std::common_reference_with</*concat-rvalue-reference-t*/<Rs...>&&, /*concat-value-t*/<Rs...> const&> && (/*concat-indirectly-readable-impl*/</*concat-reference-t*/<Rs...>, /*concat-rvalue-reference-t*/<Rs...>, ranges::iterator_t<Rs>> && ...);
template< class Ref, class RRef, class It > concept /*concat-indirectly-readable-impl*/ = // exposition only requires(const It it) { { *it } -> std::convertible_to<Ref>; { ranges::iter_move(it)} -> std::convertible_to<RRef>; };
template< class... Rs > concept /*concatable*/ = requires { // exposition only typename /*concat-reference-t*/<Rs...>; typename /*concat-value-t*/<Rs...>; typename /*concat-rvalue-reference-t*/<Rs...>; } && /*concat-indirectly-readable*/<Rs...>;
concat_view always models input_range, and models forward_range, bidirectional_range, random_access_range, or sized_range if each adapted view type models the corresponding concept.
concat_view can be common_range if the last underlying range models common_range.
Contents |
Customization point objects
The name views::concat denotes a customization point object, which is a const function object of a literal semiregular class type. See CustomizationPointObject for details.
[edit] Data members
| Member | Description |
std::tuple<Views...> views_
|
all adapted view objects (exposition-only member object*) |
[edit] Member functions
constructs a concat_view (public member function) | |
| returns an iterator to the beginning (public member function) | |
| returns an iterator or a sentinel to the end (public member function) | |
returns the number of elements, provided only if the underlying (adapted) range satisfies sized_range (public member function) | |
Inherited from std::ranges::view_interface | |
returns whether the derived view is empty, provided only if it satisfies sized_range or forward_range (public member function of std::ranges::view_interface<D>)
| |
| (C++23) |
returns a constant iterator to the beginning of the range (public member function of std::ranges::view_interface<D>)
|
| (C++23) |
returns a sentinel for the constant iterator of the range (public member function of std::ranges::view_interface<D>)
|
| returns whether the derived view is not empty, provided only if ranges::empty is applicable to it (public member function of std::ranges::view_interface<D>)
| |
returns the first element in the derived view, provided if it satisfies forward_range (public member function of std::ranges::view_interface<D>)
| |
returns the last element in the derived view, provided only if it satisfies bidirectional_range and common_range (public member function of std::ranges::view_interface<D>)
| |
returns the nth element in the derived view, provided only if it satisfies random_access_range (public member function of std::ranges::view_interface<D>)
| |