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 | 29 | 30 |
Tags
- 아두이노 컴파일러
- Arduino
- queue
- Deque
- stl
- 수광 소자
- 자료구조
- 운영체제
- 컴퓨터 그래픽스
- 라인트레이서
- C언어
- directx
- html
- LineTracer
- set
- Array
- map
- 아두이노 소스
- Stack
- list
- vector
- 시스템프로그래밍
- Algorithm
- arduino compiler
- 통계학
- c++
- priority_queue
- 아두이노
- Visual Micro
- WinAPI
Archives
- Today
- Total
Kim's Programming
List - Operator '=' 본문
소스)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | #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; } bool function(int x, int y) { if (x > y) return true; return false; } void main() { std::list<int> List = { 1,2,3,4,100,101,102,103 }; std::list<int> List_Copy = { 4,3,2,1 }; print(List); List = List_Copy; print(List); } | cs |
내용)
연산자 = 는 데이터를 이동시킬 때 씁니다. a=b의 경우 리스트 a에 리스트 b의 모든 내용을 복사하며 기존의 리스트 a의 내용은 삭제됩니다.
결과)
'STL - Container > Container - List' 카테고리의 다른 글
List - pop_front() (0) | 2016.01.29 |
---|---|
List - pop_back() (0) | 2016.01.29 |
List - merge() (0) | 2016.01.29 |
List - max_size() (0) | 2016.01.29 |
List - insert() (0) | 2016.01.29 |