-
[C++ Reference] STL QueueC++ Study 2021. 2. 11. 15:32
Queue
- FIFO 구조 : 데이터 삽입과 제거가 각기 다른 방향으로 지정되어 있다
- Container Adapter : deque 컨테이너를 상속받아 그 기능을 제한한 컨테이너, Iterator 사용이 불가하다
Iterator
- STL Queue는 Iterator가 없다!
Member Functions
-
Element Access
- element_type front() : Returns reference to the first element in the queue
- element_type back() : Returns reference to the last element in the queue
- Capacity
- bool empty() : checks whether the underlying container is empty
- int size() : returns the number of elements
- Modifiers
- void push(element_type& element) : Pushes the copied element value to the end of the queue
- void emplace(element_type& element) : Pushes the newly made instances to the end of the queue
- void pop() : removes the first element
- void swap() : swaps the contents
'C++ Study' 카테고리의 다른 글
[C++] ASCII Table (0) 2021.02.13 [C++ Reference] getline()과 cin.getline() (0) 2021.02.13 [C++ Reference] STL Stack (0) 2021.02.11 [C++ STL] STL Container 정리 (0) 2021.02.11 [C++ Study] stringstream 사용법 (0) 2021.02.10