From Jason Turner

[saferecl.hp.base]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpssmpebbq/{from.md → to.md} +48 -0
tmp/tmpssmpebbq/{from.md → to.md} RENAMED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #### Class template `hazard_pointer_obj_base` <a id="saferecl.hp.base">[[saferecl.hp.base]]</a>
2
+
3
+ ``` cpp
4
+ namespace std {
5
+ template<class T, class D = default_delete<T>>
6
+ class hazard_pointer_obj_base {
7
+ public:
8
+ void retire(D d = D()) noexcept;
9
+ protected:
10
+ hazard_pointer_obj_base() = default;
11
+ hazard_pointer_obj_base(const hazard_pointer_obj_base&) = default;
12
+ hazard_pointer_obj_base(hazard_pointer_obj_base&&) = default;
13
+ hazard_pointer_obj_base& operator=(const hazard_pointer_obj_base&) = default;
14
+ hazard_pointer_obj_base& operator=(hazard_pointer_obj_base&&) = default;
15
+ ~hazard_pointer_obj_base() = default;
16
+ private:
17
+ D deleter; // exposition only
18
+ };
19
+ }
20
+ ```
21
+
22
+ `D` shall be a function object type [[func.require]] for which, given a
23
+ value `d` of type `D` and a value `ptr` of type `T*`, the expression
24
+ `d(ptr)` is valid.
25
+
26
+ The behavior of a program that adds specializations for
27
+ `hazard_pointer_obj_base` is undefined.
28
+
29
+ `D` shall meet the requirements for *Cpp17DefaultConstructible* and
30
+ *Cpp17MoveAssignable*.
31
+
32
+ `T` may be an incomplete type. It shall be complete before any member of
33
+ the resulting specialization of `hazard_pointer_obj_base` is referenced.
34
+
35
+ ``` cpp
36
+ void retire(D d = D()) noexcept;
37
+ ```
38
+
39
+ *Mandates:* `T` is a hazard-protectable type.
40
+
41
+ *Preconditions:* `*this` is a base class subobject of an object `x` of
42
+ type `T`. `x` is not retired. Move-assigning `d` to `deleter` does not
43
+ exit via an exception.
44
+
45
+ *Effects:* Move-assigns `d` to `deleter`, thereby setting it as the
46
+ deleter of `x`, then retires `x`. May reclaim possibly-reclaimable
47
+ objects.
48
+