Namespaces
Variants

std::ranges::chunk_by_view<V,Pred>:: base

From cppreference.net
Ranges library
Range adaptors
constexpr V base ( ) const & requires std:: copy_constructible < V > ;
(1) (C++23 이후)
constexpr V base ( ) && ;
(2) (C++23 이후)

기본 뷰 base_ 의 복사본을 반환합니다.

1) 기본 뷰에서 결과를 복사 생성합니다. 다음과 동일합니다: return base_ ;
2) 결과를 기본 뷰에서 이동 생성합니다. 다음과 동일합니다: return std :: move ( base_ ) ;

매개변수

(없음)

반환값

기본 뷰의 복사본입니다.

예제

#include <algorithm>
#include <functional>
#include <ranges>
int main()
{
    static constexpr auto v = {1, 1, 2, 2, 3, 3, 3};
    constexpr auto chunks = v | std::views::chunk_by(std::equal_to{});
    static_assert(std::ranges::equal(v, chunks.base()));
}