Skip to content

Commit fc4eb17

Browse files
committed
Smart Pointers Fixed
1 parent dcb5fcf commit fc4eb17

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

ptr/ptr

100 Bytes
Binary file not shown.

ptr/ptr.cpp

+3-4
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,13 @@ class objdeleter : public deleter <T> {
4040
template <class T>
4141
class scoped_ptr {
4242
private:
43-
explicit scoped_ptr(const scoped_ptr <T>& p) {}
44-
scoped_ptr <T>& operator = (const scoped_ptr <T>& p) const {}
43+
scoped_ptr(const scoped_ptr <T>& p);
44+
scoped_ptr <T>& operator = (const scoped_ptr <T>& p) const;
4545
T* ptr;
4646
deleter <T> del;
4747

4848
public:
49-
explicit scoped_ptr(T* p = 0) { ptr = p; }
50-
explicit scoped_ptr(T* p, const deleter <T>& d) { ptr = p; del = d; }
49+
explicit scoped_ptr(T* p, const deleter <T>& d) : ptr (p), del (d) { }
5150
~scoped_ptr() {
5251
if (!isNull()) {
5352
std::cout << "At address " << this;

ptr/ptr.o

328 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)