這篇文章是這一系列文的最終章,主要介紹 container adaptors 和 兩個特殊用途的 containers : bitset, valarray。
Overview
Container Adaptor
Name |
Brief |
Capacity |
Element Access |
Modifiers |
Others |
stack |
“deque (vector, list)” |
“size, empty” |
top |
“push, pop” |
swap |
queue |
deque (list) |
“size, empty” |
“front, back” |
“push, pop” |
swap |
priority_queue |
“max heap, vector is used” |
“size, empty” |
top |
“push, pop” |
swap |
Other containers
Name |
Brief |
Meta |
Element Access |
Modifiers |
Others |
bitset |
bitwise |
“size, count, any, none, all” |
“test, operator[]” |
“set, reset, flip” |
“to_string, to_ulong, to_ullong” |
valarray |
array |
“size, max, min, sum” |
operator[] |
“shift, cshift, operator=, resize” |
“apply, swap” |
Sample Code
Comments