c.back(), c.front(), c.at(n), c[n] 都返回reference. auto &v = c.back();
calling front or back when empty and c[n], n >= c.size() will cause programming error. at is safe
pop_back and pop_front return void, so get things done before deleting.
resize(n), value initialized.(resize(n,t))
reserve(n), allocate n elements in memory
shrink_to_fit(), a request to return exceeded memory.
section 9.5 Additonal string Operations
Additonal ways to construct a str
string s(cp, n) a copy of n characters from a const char*(null terminated)
string s(s2, pos2), a copy of the characters starting from position pos2(undefined if s2.size() < pos2)
string s(s2, pos, len2), a copy of len2 characters starting from position pos2. copies at most s2.size() - pos2 characters
section 9.6 Container Adaptors
stack, queue, priority_queue.
adaptors can not use operations of underlying container type
stack can use vector, list, deque(by default). queue can use list and deque(default). priority_queue can use vector(default) and deque(not list because of random access)
queue: q.front() and q.back(); priority_queue: q.top()