Notice
Recent Posts
Recent Comments
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- 시스템프로그래밍
- html
- 아두이노
- Stack
- 컴퓨터 그래픽스
- 통계학
- 아두이노 소스
- Arduino
- list
- c++
- directx
- 자료구조
- 운영체제
- map
- Deque
- Array
- C언어
- 아두이노 컴파일러
- stl
- Algorithm
- Visual Micro
- 수광 소자
- LineTracer
- arduino compiler
- vector
- set
- priority_queue
- 라인트레이서
- WinAPI
- queue
Archives
- Today
- Total
Kim's Programming
List - emplace() 본문
소스)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | #include<list> #include<iostream> void print(std::list<int> Target_List) { for (std::list<int>::iterator IterPos = Target_List.begin(); IterPos != Target_List.end(); ++IterPos) std::cout << *IterPos << " "; std::cout << std::endl; } void main() { std::list<int> List = { 1,2,3,4,100,101,102,103 }; std::list<int>::iterator Iter = (++List.begin()); print(List); List.emplace(Iter, 4); print(List); } | cs |
내용)
emplace(x,y) 에서 이터레이터 x가 가리키는 위치에 y를 삽입합니다.(기존 데이터는 뒤로 밀려갑니다.)
결과)
'STL - Container > Container - List' 카테고리의 다른 글
List - emplace_front() (0) | 2016.01.29 |
---|---|
List - emplace_back() (0) | 2016.01.29 |
List - crend() (0) | 2016.01.28 |
List - crbegin() (0) | 2016.01.28 |
List - clear() (0) | 2016.01.28 |