sized_sentinel_for

sized_sentinel_for (크기 센티널 개념)

std::sized_sentinel_for는 센티널과 반복자 사이 거리를 상수 시간에 계산할 수 있는 개념이에요. C++20에서 추가됐어요.

출처: cppreference

본문

std::sized_sentinel_forS·I 사이의 거리를 - 연산으로 얻을 수 있는지를 나타내요.

template< class S, class I >
concept sized_sentinel_for =
    std::sentinel_for<S, I> && ...;

std::ranges::distance를 O(1)로 만들 수 있어요.

더 알아보기 (Learn more)

cppreference