2018. 1. 26. 16:23
※ advance
void advance (InputIterator & it, Distance n);
it : 이동할 반복자
n : 반복자를 이동할 값
※ distance
typename iterator_traits<InputIterator>::difference_type
distance (InputIterator first, InputIterator last);
first : 시작 위치
last : 끝 위치
반환 : 두 반복자의 범위에 존재하는 원소들의 개수
※ next
ForwardIterator next
(ForwardIterator it, typename iterator_traits<ForwardIterator>::difference_type n = 1);
it : 기준이 될 반복자(순방향 기능이 있는 반복자 가능)
n : 이동할 값
반환 : it 에서 n만큼 증가한 반복자 반환
※ prev
BidirectionalIterator prev
(BidirectionalIterator it,
typename iterator_traits<BidirectionalIterator>::difference_type n = 1);
it : 기준이 될 반복자(양방향 기능이 있는 반복자 가능)
n : 이동할 값
반환 : it 에서 n만큼 감소한 반복자 반환
'공부 > C++(STL)' 카테고리의 다른 글
람다 식(익명함수) (0) | 2018.03.01 |
---|---|
스마트 포인터 (0) | 2018.02.23 |
accumulate 함수 (0) | 2018.01.24 |
static 멤버 (0) | 2017.09.05 |
const (0) | 2017.09.05 |