主要差别: list 是双向链表,forward_list 是双向链表. 成员函数差异: 函数名 list forward_list back() has no size() has no insert() has no emplace() has no erase() has no push_back() has no emplace_back() has no splice() has no before_begin() no has cbefore_begin() no has
std::set template < class T, // set::key_type/value_type class Compare = less<T>, // set::key_compare/value_compare class Alloc = allocator<T> // set::allocator_type > class set; Set Sets are containers that store unique elements followi
std::priority_queue template <class T, class Container = vector<T>, class Compare = less<typename Container::value_type> > class priority_queue; Priority queue Priority(优先) queues are a type of container adaptors, specifically designed s
std::queue template <class T, class Container = deque<T> > class queue; FIFO queue queues are a type of container adaptor, specifically designed to operate in a FIFO context (first-in first-out), where elements are inserted into one end of the
std::map template < class Key, // map::key_type class T, // map::mapped_type class Compare = less<Key>, // map::key_compare class Alloc = allocator<pair<const Key,T> > // map::allocator_type > class map; Map Maps are associative co
std::list template < class T, class Alloc = allocator > class list; List Lists are sequence containers that allow constant time insert and erase operations anywhere within the sequence, and iteration in both directions. List containers are implement
std::forward_list template < class T, class Alloc = allocator > class forward_list; Forward list Forward lists are sequence containers that allow constant time insert and erase operations anywhere within the sequence. Forward lists are implemented a
std::deque template < class T, class Alloc = allocator > class deque; Double ended queue deque means double enden queue; deque (usually pronounced like "deck") is an irregular acronym of double-ended queue. Double-ended queues are sequence
std::array template < class T, size_t N > class array; Code Example #include <iostream> #include <array> #include <cstring> using namespace std; int main(int argc, char **argv) { array<int, 5> intArr = {1,2,3,4,5}; for(auto i
http://stackoverflow.com/questions/20516773/stdunique-lockstdmutex-or-stdlock-guardstdmutex The difference is that you can lock and unlock a std::unique_lock. std::lock_guard will be locked only once on construction and unlocked on destruction. So fo