From Jason Turner

[any.cons]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpc007eod1/{from.md → to.md} +99 -0
tmp/tmpc007eod1/{from.md → to.md} RENAMED
@@ -0,0 +1,99 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #### Construction and destruction <a id="any.cons">[[any.cons]]</a>
2
+
3
+ ``` cpp
4
+ constexpr any() noexcept;
5
+ ```
6
+
7
+ *Postconditions:* `has_value()` is `false`.
8
+
9
+ ``` cpp
10
+ any(const any& other);
11
+ ```
12
+
13
+ *Effects:* If `other.has_value()` is `false`, constructs an object that
14
+ has no value. Otherwise, equivalent to
15
+ `any(in_place<T>, any_cast<const T&>(other))` where `T` is the type of
16
+ the contained object.
17
+
18
+ *Throws:* Any exceptions arising from calling the selected constructor
19
+ for the contained value.
20
+
21
+ ``` cpp
22
+ any(any&& other) noexcept;
23
+ ```
24
+
25
+ *Effects:* If `other.has_value()` is `false`, constructs an object that
26
+ has no value. Otherwise, constructs an object of type `any` that
27
+ contains either the contained object of `other`, or contains an object
28
+ of the same type constructed from the contained object of `other`
29
+ considering that contained object as an rvalue.
30
+
31
+ *Postconditions:* `other` is left in a valid but otherwise unspecified
32
+ state.
33
+
34
+ ``` cpp
35
+ template<class T>
36
+ any(T&& value);
37
+ ```
38
+
39
+ Let `VT` be `decay_t<T>`.
40
+
41
+ *Requires:* `VT` shall satisfy the `CopyConstructible` requirements.
42
+
43
+ *Effects:* Constructs an object of type `any` that contains an object of
44
+ type `VT` direct-initialized with `std::forward<T>(value)`.
45
+
46
+ *Remarks:* This constructor shall not participate in overload resolution
47
+ unless `VT` is not the same type as `any`, `VT` is not a specialization
48
+ of `in_place_type_t`, and `is_copy_constructible_v<VT>` is `true`.
49
+
50
+ *Throws:* Any exception thrown by the selected constructor of `VT`.
51
+
52
+ ``` cpp
53
+ template <class T, class... Args>
54
+ explicit any(in_place_type_t<T>, Args&&... args);
55
+ ```
56
+
57
+ Let `VT` be `decay_t<T>`.
58
+
59
+ *Requires:* `VT` shall satisfy the `CopyConstructible` requirements.
60
+
61
+ *Effects:* Initializes the contained value as if
62
+ direct-non-list-initializing an object of type `VT` with the arguments
63
+ `std::forward<Args>(args)...`.
64
+
65
+ *Postconditions:* `*this` contains a value of type `VT`.
66
+
67
+ *Throws:* Any exception thrown by the selected constructor of `VT`.
68
+
69
+ *Remarks:* This constructor shall not participate in overload resolution
70
+ unless `is_copy_constructible_v<VT>` is `true` and
71
+ `is_constructible_v<VT, Args...>` is `true`.
72
+
73
+ ``` cpp
74
+ template <class T, class U, class... Args>
75
+ explicit any(in_place_type_t<T>, initializer_list<U> il, Args&&... args);
76
+ ```
77
+
78
+ Let `VT` be `decay_t<T>`.
79
+
80
+ *Requires:* `VT` shall satisfy the `CopyConstructible` requirements.
81
+
82
+ *Effects:* Initializes the contained value as if
83
+ direct-non-list-initializing an object of type `VT` with the arguments
84
+ `il, std::forward<Args>(args)...`.
85
+
86
+ *Postconditions:* `*this` contains a value.
87
+
88
+ *Throws:* Any exception thrown by the selected constructor of `VT`.
89
+
90
+ *Remarks:* This constructor shall not participate in overload resolution
91
+ unless `is_copy_constructible_v<VT>` is `true` and
92
+ `is_constructible_v<VT, initializer_list<U>&, Args...>` is `true`.
93
+
94
+ ``` cpp
95
+ ~any();
96
+ ```
97
+
98
+ *Effects:* As if by `reset()`.
99
+