… | … | ||
---|---|---|---|
107 | a.p = 0; | 107 | a.p = 0; |
108 | } | 108 | } |
109 | 109 | ||
110 | ~auto_ptr () | 110 | ~auto_ptr () |
111 | { | 111 | { |
112 | delete p; | 112 | free (p); |
113 | } | 113 | } |
114 | 114 | ||
115 | // void because it makes sense in our context | 115 | // void because it makes sense in our context |
116 | void operator = (T *a) | 116 | void operator = (T *a) |
117 | { | 117 | { |
118 | delete p; | 118 | free (p); |
119 | p = a; | 119 | p = a; |
120 | } | 120 | } |
121 | 121 | ||
122 | void operator = (auto_ptr &a) | 122 | void operator = (auto_ptr &a) |
123 | { | 123 | { |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |