From Jason Turner

[any.cons]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmphm0xusl9/{from.md → to.md} +33 -38
tmp/tmphm0xusl9/{from.md → to.md} RENAMED
@@ -2,97 +2,92 @@
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()`.
 
2
 
3
  ``` cpp
4
  constexpr any() noexcept;
5
  ```
6
 
7
+ *Ensures:* `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_type<T>, any_cast<const T&>(other))` where `T` is the type
16
+ of the contained value.
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 value of `other`, or contains an object of
28
+ the same type constructed from the contained value of `other`
29
+ considering that contained value as an rvalue.
 
 
 
30
 
31
  ``` cpp
32
  template<class T>
33
  any(T&& value);
34
  ```
35
 
36
  Let `VT` be `decay_t<T>`.
37
 
38
+ *Constraints:* `VT` is not the same type as `any`, `VT` is not a
39
+ specialization of `in_place_type_t`, and `is_copy_constructible_v<VT>`
40
+ is `true`.
41
+
42
+ *Preconditions:* `VT` meets the *Cpp17CopyConstructible* requirements.
43
 
44
  *Effects:* Constructs an object of type `any` that contains an object of
45
  type `VT` direct-initialized with `std::forward<T>(value)`.
46
 
 
 
 
 
47
  *Throws:* Any exception thrown by the selected constructor of `VT`.
48
 
49
  ``` cpp
50
  template<class T, class... Args>
51
  explicit any(in_place_type_t<T>, Args&&... args);
52
  ```
53
 
54
  Let `VT` be `decay_t<T>`.
55
 
56
+ *Constraints:* `is_copy_constructible_v<VT>` is `true` and
 
 
 
 
 
 
 
 
 
 
 
57
  `is_constructible_v<VT, Args...>` is `true`.
58
 
59
+ *Preconditions:* `VT` meets the *Cpp17CopyConstructible* 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
+ *Ensures:* `*this` contains a value of type `VT`.
66
+
67
+ *Throws:* Any exception thrown by the selected constructor of `VT`.
68
+
69
  ``` cpp
70
  template<class T, class U, class... Args>
71
  explicit any(in_place_type_t<T>, initializer_list<U> il, Args&&... args);
72
  ```
73
 
74
  Let `VT` be `decay_t<T>`.
75
 
76
+ *Constraints:* `is_copy_constructible_v<VT>` is `true` and
 
 
 
 
 
 
 
 
 
 
 
77
  `is_constructible_v<VT, initializer_list<U>&, Args...>` is `true`.
78
 
79
+ *Preconditions:* `VT` meets the *Cpp17CopyConstructible* requirements.
80
+
81
+ *Effects:* Initializes the contained value as if
82
+ direct-non-list-initializing an object of type `VT` with the arguments
83
+ `il, std::forward<Args>(args)...`.
84
+
85
+ *Ensures:* `*this` contains a value.
86
+
87
+ *Throws:* Any exception thrown by the selected constructor of `VT`.
88
+
89
  ``` cpp
90
  ~any();
91
  ```
92
 
93
  *Effects:* As if by `reset()`.