STL中各容器和適配器類的定義

//序列式容器
1.vector
template <class _Tp, class _Alloc = __STL_DEFAULT_ALLOCATOR(_Tp) >
class vector : protected _Vector_base<_Tp, _Alloc> {...}less

2.list
template <class _Tp, class _Alloc = __STL_DEFAULT_ALLOCATOR(_Tp) >
class list : protected _List_base<_Tp, _Alloc> {...}hash

3.slist
template <class _Tp, class _Alloc = __STL_DEFAULT_ALLOCATOR(_Tp) >
class slist : private _Slist_base<_Tp,_Alloc>
{...}it

4.deque
template <class _Tp, class _Alloc = __STL_DEFAULT_ALLOCATOR(_Tp),
size_t __bufsiz = 0>
class deque : protected _Deque_base<_Tp, _Alloc, __bufsiz>{...}io

//適配器
1.queue
template <class _Tp, class _Sequence>
class queue {...}table

2.priority_queue
template <class _Tp,
class _Sequence __STL_DEPENDENT_DEFAULT_TMPL(deque<_Tp>),
class _Compare
__STL_DEPENDENT_DEFAULT_TMPL(less<typename _Sequence::value_type>) >
class priority_queue {...}class

3.stack
template <class _Tp, class _Sequence>
class stack {...}容器

//關聯容器
1.map
template <class _Key, class _Tp, class _Compare, class _Alloc>
class map {...}hashmap

2.multimap
template <class _Key, class _Tp, class _Compare, class _Alloc>
class multimap {...}List

3.hashmap
template <class _Key, class _Tp, class _HashFcn, class _EqualKey,
class _Alloc>
class hash_map {...}map

4.set
template <class _Key, class _Compare, class _Alloc>
class set {...}

5.multiset
template <class _Key, class _Compare, class _Alloc>
class multiset {...}

6.hash_set
template <class _Value, class _HashFcn, class _EqualKey, class _Alloc>
class hash_set {...}

7.hashtabletemplate <class _Val, class _Key, class _HashFcn, class _ExtractKey, class _EqualKey, class _Alloc>class hashtable {...}

相關文章
相關標籤/搜索