std::basic_string<CharT,Traits,Allocator>:: end, std::basic_string<CharT,Traits,Allocator>:: cend
From cppreference.net
<
cpp
|
string
|
basic string
C++
Strings library
| Classes | ||||
|
(C++17)
|
||||
std::basic_string
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
iterator end
(
)
;
|
(1) |
(C++11부터 noexcept)
(C++20부터 constexpr) |
|
const_iterator end
(
)
const
;
|
(2) |
(C++11부터 noexcept)
(C++20부터 constexpr) |
|
const_iterator cend
(
)
const
noexcept
;
|
(3) |
(C++11부터)
(C++20부터 constexpr) |
문자열의 마지막 문자 다음에 위치한 문자를 가리키는 반복자를 반환합니다. 이 문자는 자리 표시자 역할을 하며, 접근을 시도할 경우 정의되지 않은 동작이 발생합니다.
목차 |
매개변수
(없음)
반환값
마지막 문자 다음에 오는 문자에 대한 반복자.
복잡도
상수.
참고 사항
libc++ 백포트는
cend()
를 C++98 모드로 이식합니다.
예제
이 코드 실행
#include <algorithm> #include <iostream> #include <iterator> #include <string> int main() { std::string s("Exemparl"); std::next_permutation(s.begin(), s.end()); std::string c; std::copy(s.cbegin(), s.cend(), std::back_inserter(c)); std::cout << c << '\n'; // "Exemplar" }
출력:
Exemplar
참고 항목
|
(C++11)
|
시작 부분에 대한 반복자를 반환합니다
(public member function) |
|
끝 부분에 대한 반복자를 반환합니다
(
std::basic_string_view<CharT,Traits>
의
public member function)
|