From Jason Turner

[util.smartptr.shared.const]

Diff to HTML by rtfpessoa

tmp/tmp76_99v2c/{from.md → to.md} RENAMED
@@ -4,11 +4,11 @@
4
  constexpr shared_ptr() noexcept;
5
  ```
6
 
7
  *Effects:* Constructs an *empty* `shared_ptr` object.
8
 
9
- *Postconditions:* `use_count() == 0 && get() == 0`.
10
 
11
  ``` cpp
12
  template<class Y> explicit shared_ptr(Y* p);
13
  ```
14
 
@@ -62,19 +62,19 @@ template<class Y> shared_ptr(const shared_ptr<Y>& r, T *p) noexcept;
62
  To avoid the possibility of a dangling pointer, the user of this
63
  constructor must ensure that `p` remains valid at least until the
64
  ownership group of `r` is destroyed.
65
 
66
  This constructor allows creation of an *empty* `shared_ptr` instance
67
- with a non-NULL stored pointer.
68
 
69
  ``` cpp
70
  shared_ptr(const shared_ptr& r) noexcept;
71
  template<class Y> shared_ptr(const shared_ptr<Y>& r) noexcept;
72
  ```
73
 
74
- *Requires:* The second constructor shall not participate in the overload
75
- resolution unless `Y*` is implicitly convertible to `T*`.
76
 
77
  *Effects:* If `r` is *empty*, constructs an *empty* `shared_ptr` object;
78
  otherwise, constructs a `shared_ptr` object that *shares ownership* with
79
  `r`.
80
 
@@ -89,11 +89,11 @@ The second constructor shall not participate in overload resolution
89
  unless `Y*` is convertible to `T*`.
90
 
91
  *Effects:* Move-constructs a `shared_ptr` instance from `r`.
92
 
93
  *Postconditions:* `*this` shall contain the old value of `r`. `r` shall
94
- be *empty*. `r.get() == 0.`
95
 
96
  ``` cpp
97
  template<class Y> explicit shared_ptr(const weak_ptr<Y>& r);
98
  ```
99
 
@@ -117,11 +117,11 @@ complete type. The expression `delete r.release()` shall be well formed,
117
  shall have well defined behavior, and shall not throw exceptions.
118
 
119
  *Effects:* Constructs a `shared_ptr` object that stores and *owns*
120
  `r.release()`.
121
 
122
- *Postconditions:* `use_count() == 1` `&&` `r.get() == 0`.
123
 
124
  *Throws:* `bad_alloc`, or an *implementation-defined* exception when a
125
  resource other than memory could not be obtained.
126
 
127
  If an exception is thrown, the constructor has no effect.
 
4
  constexpr shared_ptr() noexcept;
5
  ```
6
 
7
  *Effects:* Constructs an *empty* `shared_ptr` object.
8
 
9
+ *Postconditions:* `use_count() == 0 && get() == nullptr`.
10
 
11
  ``` cpp
12
  template<class Y> explicit shared_ptr(Y* p);
13
  ```
14
 
 
62
  To avoid the possibility of a dangling pointer, the user of this
63
  constructor must ensure that `p` remains valid at least until the
64
  ownership group of `r` is destroyed.
65
 
66
  This constructor allows creation of an *empty* `shared_ptr` instance
67
+ with a non-null stored pointer.
68
 
69
  ``` cpp
70
  shared_ptr(const shared_ptr& r) noexcept;
71
  template<class Y> shared_ptr(const shared_ptr<Y>& r) noexcept;
72
  ```
73
 
74
+ The second constructor shall not participate in overload resolution
75
+ unless `Y*` is implicitly convertible to `T*`.
76
 
77
  *Effects:* If `r` is *empty*, constructs an *empty* `shared_ptr` object;
78
  otherwise, constructs a `shared_ptr` object that *shares ownership* with
79
  `r`.
80
 
 
89
  unless `Y*` is convertible to `T*`.
90
 
91
  *Effects:* Move-constructs a `shared_ptr` instance from `r`.
92
 
93
  *Postconditions:* `*this` shall contain the old value of `r`. `r` shall
94
+ be *empty*. `r.get() == nullptr.`
95
 
96
  ``` cpp
97
  template<class Y> explicit shared_ptr(const weak_ptr<Y>& r);
98
  ```
99
 
 
117
  shall have well defined behavior, and shall not throw exceptions.
118
 
119
  *Effects:* Constructs a `shared_ptr` object that stores and *owns*
120
  `r.release()`.
121
 
122
+ *Postconditions:* `use_count() == 1` `&&` `r.get() == nullptr`.
123
 
124
  *Throws:* `bad_alloc`, or an *implementation-defined* exception when a
125
  resource other than memory could not be obtained.
126
 
127
  If an exception is thrown, the constructor has no effect.