From Jason Turner

[indirect.general]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmphhtgw7f8/{from.md → to.md} +46 -0
tmp/tmphhtgw7f8/{from.md → to.md} RENAMED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #### General <a id="indirect.general">[[indirect.general]]</a>
2
+
3
+ An indirect object manages the lifetime of an owned object. An indirect
4
+ object is *valueless* if it has no owned object. An indirect object may
5
+ become valueless only after it has been moved from.
6
+
7
+ In every specialization `indirect<T, Allocator>`, if the type
8
+ `allocator_traits<Allocator>::value_type` is not the same type as `T`,
9
+ the program is ill-formed. Every object of type `indirect<T, Allocator>`
10
+ uses an object of type `Allocator` to allocate and free storage for the
11
+ owned object as needed.
12
+
13
+ Constructing an owned object with `args...` using the allocator `a`
14
+ means calling `allocator_traits<Allocator>::construct(a, p, args...)`
15
+ where `args` is an expression pack, `a` is an allocator, and *`p`* is a
16
+ pointer obtained by calling `allocator_traits<Allocator>::allocate`.
17
+
18
+ The member *`alloc`* is used for any memory allocation and element
19
+ construction performed by member functions during the lifetime of each
20
+ indirect object. The allocator *`alloc`* may be replaced only via
21
+ assignment or `swap()`. `Allocator` replacement is performed by copy
22
+ assignment, move assignment, or swapping of the allocator only if
23
+ [[container.reqmts]]:
24
+
25
+ - `allocator_traits<Allocator>::propagate_on_container_copy_assignment::value`,
26
+ or
27
+ - `allocator_traits<Allocator>::propagate_on_container_move_assignment::value`,
28
+ or
29
+ - `allocator_traits<Allocator>::propagate_on_container_swap::value`
30
+
31
+ is `true` within the implementation of the corresponding `indirect`
32
+ operation.
33
+
34
+ A program that instantiates the definition of the template
35
+ `indirect<T, Allocator>` with a type for the `T` parameter that is a
36
+ non-object type, an array type, `in_place_t`, a specialization of
37
+ `in_place_type_t`, or a cv-qualified type is ill-formed.
38
+
39
+ The template parameter `T` of `indirect` may be an incomplete type.
40
+
41
+ The template parameter `Allocator` of `indirect` shall meet the
42
+ *Cpp17Allocator* requirements.
43
+
44
+ If a program declares an explicit or partial specialization of
45
+ `indirect`, the behavior is undefined.
46
+