Namespaces
Variants

std::ranges::stride_view<V>::iterator<Const>::operator*

cppreference.net에서 가져옴
 
 
범위 라이브러리
범위 어댑터
 
 
constexpr decltype(auto) operator*() const;
(C++23부터)

기반 반복자가 가리키는 요소들을 반환합니다. V current_

다음과 동일함: return *current_;.

매개변수

(없음)

반환값

현재 요소.

참고 사항

operator - > 는 제공되지 않습니다.

예제

#include <ranges>
int main()
{
    constexpr static auto v = {'a', 'b', 'c', 'd', 'e'};
    constexpr auto view{v | std::views::stride(2)};
    constexpr auto iter{view.begin() + 1};
    static_assert(*iter == 'c');
    static_assert(*(view.begin() + 2) == 'e');
}

참고 항목

(C++23)
인덱스로 요소에 접근
(public member function)