Skip to content

Commit 78143ab

Browse files
committed
📋 Add some notes.
1 parent 09766b0 commit 78143ab

File tree

6 files changed

+54
-0
lines changed

6 files changed

+54
-0
lines changed

MyTinySTL/deque.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,17 @@
44
// 这个头文件包含了一个模板类 deque
55
// deque: 双端队列
66

7+
// notes:
8+
//
9+
// 异常保证:
10+
// mystl::deque<T> 满足基本异常保证,部分函数无异常保证,并对以下等函数做强异常安全保证:
11+
// * emplace_front
12+
// * emplace_back
13+
// * emplace
14+
// * push_front
15+
// * push_back
16+
// * insert
17+
718
#include <initializer_list>
819

920
#include "iterator.h"

MyTinySTL/list.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,17 @@
44
// 这个头文件包含了一个模板类 list
55
// list : 双向链表
66

7+
// notes:
8+
//
9+
// 异常保证:
10+
// mystl::list<T> 满足基本异常保证,部分函数无异常保证,并对以下等函数做强异常安全保证:
11+
// * emplace_front
12+
// * emplace_back
13+
// * emplace
14+
// * push_front
15+
// * push_back
16+
// * insert
17+
718
#include <initializer_list>
819

920
#include "iterator.h"

MyTinySTL/map.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@
55
// map : 映射,元素具有键值和实值,会根据键值大小自动排序,键值不允许重复
66
// multimap : 映射,元素具有键值和实值,会根据键值大小自动排序,键值允许重复
77

8+
// notes:
9+
//
10+
// 异常保证:
11+
// mystl::map<Key, T> / mystl::multimap<Key, T> 满足基本异常保证,对以下等函数做强异常安全保证:
12+
// * emplace
13+
// * emplace_hint
14+
// * insert
15+
816
#include "rb_tree.h"
917

1018
namespace mystl

MyTinySTL/set.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@
55
// set : 集合,键值即实值,集合内元素会自动排序,键值不允许重复
66
// multiset : 集合,键值即实值,集合内元素会自动排序,键值允许重复
77

8+
// notes:
9+
//
10+
// 异常保证:
11+
// mystl::set<Key> / mystl::multiset<Key> 满足基本异常保证,对以下等函数做强异常安全保证:
12+
// * emplace
13+
// * emplace_hint
14+
// * insert
15+
816
#include "rb_tree.h"
917

1018
namespace mystl

MyTinySTL/unordered_map.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@
44
// 这个头文件包含两个模板类 unordered_map 和 unordered_multimap
55
// 功能与用法与 map 和 multimap 类似,不同的是使用 hashtable 作为底层实现机制,容器内的元素不会自动排序
66

7+
// notes:
8+
//
9+
// 异常保证:
10+
// mystl::unordered_map<Key, T> / mystl::unordered_multimap<Key, T> 满足基本异常保证,对以下等函数做强异常安全保证:
11+
// * emplace
12+
// * emplace_hint
13+
// * insert
14+
715
#include "hashtable.h"
816

917
namespace mystl

MyTinySTL/unordered_set.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@
44
// 这个头文件包含两个模板类 unordered_set 和 unordered_multiset
55
// 功能与用法与 set 和 multiset 类似,不同的是使用 hashtable 作为底层实现机制,容器中的元素不会自动排序
66

7+
// notes:
8+
//
9+
// 异常保证:
10+
// mystl::unordered_set<Key> / mystl::unordered_multiset<Key> 满足基本异常保证,对以下等函数做强异常安全保证:
11+
// * emplace
12+
// * emplace_hint
13+
// * insert
14+
715
#include "hashtable.h"
816

917
namespace mystl

0 commit comments

Comments
 (0)