Namespaces
Variants

std::basic_string_view<CharT,Traits>::end, std::basic_string_view<CharT,Traits>::cend

cppreference.net에서
 
 
 
 
constexpr const_iterator end() const noexcept;
(C++17부터)
constexpr const_iterator cend() const noexcept;
(C++17부터)

뷰의 마지막 문자 뒤에 오는 문자를 가리키는 반복자를 반환합니다. 이 문자는 플레이스홀더 역할을 하며, 접근을 시도하면 정의되지 않은 동작이 발생합니다.

매개변수

(없음)

반환값

const_iterator 마지막 문자 다음 문자를 가리키는 반복자입니다.

복잡도

상수.

예제

#include <iostream>
#include <iterator>
#include <string_view>
int main()
{
    constexpr std::string_view str_view("abcd");
    constexpr auto end = str_view.end();
    constexpr auto cend = str_view.cend();
    static_assert
    (
        *std::prev(end) == 'd' && 'd' == *std::prev(cend) and end == cend
    );
}

참고 항목

시작 부분에 대한 반복자를 반환함
(공개 멤버 함수)
(C++11)
끝 부분에 대한 반복자를 반환함
( std::basic_string<CharT,Traits,Allocator> 의 공개 멤버 함수)