template < class charT, class traits = char_traits<charT>, // basic_string::traits_type class Alloc = allocator<charT> // basic_string::allocator_type > class basic_string;
| 成員型別 | 定義 | 說明 |
|---|---|---|
| traits_type | 第二個模板引數 (特性 (traits)) | 預設為char_traits<charT> |
| allocator_type | 第三個模板引數 (Alloc) | 預設為allocator<charT> |
| value_type | traits_type::char_type | 應與charT |
| 引用 | allocator_type::reference | 對於預設的 allocatorcharT& |
| const_reference | allocator_type::const_reference | 對於預設的 allocatorconst charT& |
| 指標 | allocator_type::pointer | 對於預設的 allocatorcharT* |
| const_pointer | allocator_type::const_pointer | 對於預設的 allocatorconst charT* |
| iterator | 一個指向charT | 的 隨機訪問迭代器,可轉換為const_iterator |
| const_iterator | 一個指向const charT | |
| reverse_iterator | reverse_iterator<iterator> | |
| const_reverse_iterator | reverse_iterator<const_iterator> | |
| difference_type | allocator_type::difference_type | 相同,通常與 ptrdiff_t 一樣 |
| size_type | allocator_type::size_type | 的無符號整數型別,通常與 size_t 一樣 |
| 成員型別 | 定義 | 說明 |
|---|---|---|
| traits_type | 第二個模板引數 (特性 (traits)) | 預設為char_traits<charT> |
| allocator_type | 第三個模板引數 (Alloc) | 預設為allocator<charT> |
| value_type | traits_type::char_type | 應與charT |
| 引用 | value_type& | |
| const_reference | const value_type& | |
| 指標 | allocator_traits<allocator_type>::pointer | 對於預設的 allocatorcharT* |
| const_pointer | allocator_traits<allocator_type>::const_pointer | 對於預設的 allocatorconst charT* |
| iterator | 一個指向charT | 的 隨機訪問迭代器,可轉換為const_iterator |
| const_iterator | 一個指向const charT | |
| reverse_iterator | reverse_iterator<iterator> | |
| const_reverse_iterator | reverse_iterator<const_iterator> | |
| difference_type | allocator_traits<allocator_type>::difference_type | 相同,通常與 ptrdiff_t 一樣 |
| size_type | allocator_traits<allocator_type>::size_type | 的無符號整數型別,通常與 size_t 一樣 |