blob: e9fd8b683ca79d1420eef3e7f42a19b7e8202256 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
--- sptr.hh.orig 2015-09-16 07:28:04 UTC
+++ sptr.hh
@@ -25,9 +25,9 @@ class sptr_base
public:
- sptr_base(): p( 0 ), count( 0 ) {}
+ sptr_base(): p( nullptr ), count( nullptr ) {}
- sptr_base( T * p_ ): p( p_ ), count( p ? new unsigned( 1 ) : 0 )
+ sptr_base( T * p_ ): p( p_ ), count( p ? new unsigned( 1 ) : nullptr )
{
}
@@ -48,27 +48,27 @@ class sptr_base
{
delete count;
- count = 0;
+ count = nullptr;
if ( p )
{
T * p_ = p;
- p = 0;
+ p = nullptr;
delete p_;
}
}
else
{
- p = 0;
- count = 0;
+ p = nullptr;
+ count = nullptr;
}
}
}
unsigned use_count() const
- { return count; }
+ { return *count; }
sptr_base & operator = ( sptr_base const & other )
{ if ( &other != this ) { reset(); p = other.p; count = other.count; increment(); }
|