From Jason Turner

[util.smartptr.shared.obs]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpyqxtttv6/{from.md → to.md} +19 -19
tmp/tmpyqxtttv6/{from.md → to.md} RENAMED
@@ -1,6 +1,6 @@
1
- #### Observers <a id="util.smartptr.shared.obs">[[util.smartptr.shared.obs]]</a>
2
 
3
  ``` cpp
4
  element_type* get() const noexcept;
5
  ```
6
 
@@ -8,11 +8,11 @@ element_type* get() const noexcept;
8
 
9
  ``` cpp
10
  T& operator*() const noexcept;
11
  ```
12
 
13
- *Preconditions:* `get() != 0`.
14
 
15
  *Returns:* `*get()`.
16
 
17
  *Remarks:* When `T` is an array type or cv `void`, it is unspecified
18
  whether this member function is declared. If it is declared, it is
@@ -22,11 +22,11 @@ well-formed.
22
 
23
  ``` cpp
24
  T* operator->() const noexcept;
25
  ```
26
 
27
- *Preconditions:* `get() != 0`.
28
 
29
  *Returns:* `get()`.
30
 
31
  *Remarks:* When `T` is an array type, it is unspecified whether this
32
  member function is declared. If it is declared, it is unspecified what
@@ -35,47 +35,47 @@ necessarily the definition) of the function shall be well-formed.
35
 
36
  ``` cpp
37
  element_type& operator[](ptrdiff_t i) const;
38
  ```
39
 
40
- *Preconditions:* `get() != 0 && i >= 0`. If `T` is `U[N]`, `i < N`.
 
41
 
42
  *Returns:* `get()[i]`.
43
 
44
- *Remarks:* When `T` is not an array type, it is unspecified whether this
45
- member function is declared. If it is declared, it is unspecified what
46
- its return type is, except that the declaration (although not
47
- necessarily the definition) of the function shall be well-formed.
48
-
49
  *Throws:* Nothing.
50
 
 
 
 
 
 
51
  ``` cpp
52
  long use_count() const noexcept;
53
  ```
54
 
 
 
55
  *Returns:* The number of `shared_ptr` objects, `*this` included, that
56
  share ownership with `*this`, or `0` when `*this` is empty.
57
 
58
- *Synchronization:* None.
59
-
60
- [*Note 1*: `get() == nullptr` does not imply a specific return value of
61
  `use_count()`. — *end note*]
62
 
63
- [*Note 2*: `weak_ptr<T>::lock()` can affect the return value of
64
  `use_count()`. — *end note*]
65
 
66
- [*Note 3*: When multiple threads can affect the return value of
67
- `use_count()`, the result should be treated as approximate. In
68
- particular, `use_count() == 1` does not imply that accesses through a
69
- previously destroyed `shared_ptr` have in any sense
70
- completed. — *end note*]
71
 
72
  ``` cpp
73
  explicit operator bool() const noexcept;
74
  ```
75
 
76
- *Returns:* `get() != 0`.
77
 
78
  ``` cpp
79
  template<class U> bool owner_before(const shared_ptr<U>& b) const noexcept;
80
  template<class U> bool owner_before(const weak_ptr<U>& b) const noexcept;
81
  ```
 
1
+ ##### Observers <a id="util.smartptr.shared.obs">[[util.smartptr.shared.obs]]</a>
2
 
3
  ``` cpp
4
  element_type* get() const noexcept;
5
  ```
6
 
 
8
 
9
  ``` cpp
10
  T& operator*() const noexcept;
11
  ```
12
 
13
+ *Preconditions:* `get() != nullptr`.
14
 
15
  *Returns:* `*get()`.
16
 
17
  *Remarks:* When `T` is an array type or cv `void`, it is unspecified
18
  whether this member function is declared. If it is declared, it is
 
22
 
23
  ``` cpp
24
  T* operator->() const noexcept;
25
  ```
26
 
27
+ *Preconditions:* `get() != nullptr`.
28
 
29
  *Returns:* `get()`.
30
 
31
  *Remarks:* When `T` is an array type, it is unspecified whether this
32
  member function is declared. If it is declared, it is unspecified what
 
35
 
36
  ``` cpp
37
  element_type& operator[](ptrdiff_t i) const;
38
  ```
39
 
40
+ *Preconditions:* `get() != nullptr && i >= 0`. If `T` is `U[N]`,
41
+ `i < N`.
42
 
43
  *Returns:* `get()[i]`.
44
 
 
 
 
 
 
45
  *Throws:* Nothing.
46
 
47
+ *Remarks:* When `T` is not an array type, it is unspecified whether this
48
+ member function is declared. If it is declared, it is unspecified what
49
+ its return type is, except that the declaration (although not
50
+ necessarily the definition) of the function shall be well-formed.
51
+
52
  ``` cpp
53
  long use_count() const noexcept;
54
  ```
55
 
56
+ *Synchronization:* None.
57
+
58
  *Returns:* The number of `shared_ptr` objects, `*this` included, that
59
  share ownership with `*this`, or `0` when `*this` is empty.
60
 
61
+ [*Note 4*: `get() == nullptr` does not imply a specific return value of
 
 
62
  `use_count()`. — *end note*]
63
 
64
+ [*Note 5*: `weak_ptr<T>::lock()` can affect the return value of
65
  `use_count()`. — *end note*]
66
 
67
+ [*Note 6*: When multiple threads might affect the return value of
68
+ `use_count()`, the result is approximate. In particular,
69
+ `use_count() == 1` does not imply that accesses through a previously
70
+ destroyed `shared_ptr` have in any sense completed. — *end note*]
 
71
 
72
  ``` cpp
73
  explicit operator bool() const noexcept;
74
  ```
75
 
76
+ *Returns:* `get() != nullptr`.
77
 
78
  ``` cpp
79
  template<class U> bool owner_before(const shared_ptr<U>& b) const noexcept;
80
  template<class U> bool owner_before(const weak_ptr<U>& b) const noexcept;
81
  ```