std::ranges::adjacent_view<V,N>:: iterator <Const>:: operator*
From cppreference.net
<
cpp
|
ranges
|
adjacent view
|
iterator
C++
Ranges library
|
||||||||||||||||||||||
| Range primitives | |||||||
|
|||||||
| Range concepts | |||||||||||||||||||
|
|||||||||||||||||||
| Range factories | |||||||||
|
|||||||||
| Range adaptors | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||
| Helper items | |||||||||||||||||
|
|
||||||||||||||||
std::ranges::adjacent_view
| Member functions | ||||
|
(C++26)
|
||||
| Iterator | ||||
| Member functions | ||||
|
adjacent_view::
iterator
::operator*
|
||||
| Non-member functions | ||||
| Sentinel | ||||
| Member functions | ||||
| Non-member functions | ||||
|
constexpr
auto
operator
*
(
)
const
;
|
(desde C++23) | |
Devuelve los elementos hacia V a los que apunta el array subyacente de iteradores.
Sea
current_
un array subyacente de iteradores.
Equivalente a:
return /*tuple-transform*/([](auto& i) -> decltype(auto) { return *i; }, current_);
Contenidos |
Parámetros
(ninguno)
Valor de retorno
El elemento actual, que es un std::tuple de referencias a los elementos subyacentes.
Notas
operator - > no está proporcionado.
Ejemplo
Ejecutar este código
#include <ranges> #include <tuple> int main() { constexpr static auto v = {0, 1, 2, 3, 4, 5}; // └──┬──┘ // └─────────────────┐ constexpr auto view {v | std::views::adjacent<3>}; // │ constexpr auto iter {view.begin() + 2}; // │ // ┌────────────────────┬────────────────┘ // │ ┌──┴──┐ static_assert(*iter == std::tuple{2, 3, 4}); }
Véase también
|
(C++23)
|
accede a un elemento por índice
(función miembro pública) |