From Jason Turner

[refwrap.const]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp4h0li6i4/{from.md → to.md} +20 -5
tmp/tmp4h0li6i4/{from.md → to.md} RENAMED
@@ -1,16 +1,31 @@
1
- #### `reference_wrapper` construct/copy/destroy <a id="refwrap.const">[[refwrap.const]]</a>
2
 
3
  ``` cpp
4
- reference_wrapper(T& t) noexcept;
 
5
  ```
6
 
7
- *Effects:* Constructs a `reference_wrapper` object that stores a
8
- reference to `t`.
9
 
10
  ``` cpp
11
- reference_wrapper(const reference_wrapper& x) noexcept;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  ```
13
 
14
  *Effects:* Constructs a `reference_wrapper` object that stores a
15
  reference to `x.get()`.
16
 
 
1
+ #### Constructors and destructor <a id="refwrap.const">[[refwrap.const]]</a>
2
 
3
  ``` cpp
4
+ template<class U>
5
+ constexpr reference_wrapper(U&& u) noexcept(see below);
6
  ```
7
 
8
+ Let *FUN* denote the exposition-only functions
 
9
 
10
  ``` cpp
11
+ void FUN(T&) noexcept;
12
+ void FUN(T&&) = delete;
13
+ ```
14
+
15
+ *Constraints:* The expression *FUN*(declval\<U\>()) is well-formed and
16
+ `is_same_v<remove_cvref_t<U>, reference_wrapper>` is `false`.
17
+
18
+ *Effects:* Creates a variable `r` as if by `T& r = std::forward<U>(u)`,
19
+ then constructs a `reference_wrapper` object that stores a reference to
20
+ `r`.
21
+
22
+ *Remarks:* The expression inside `noexcept` is equivalent to
23
+ `noexcept(`*`FUN`*`(declval<U>()))`.
24
+
25
+ ``` cpp
26
+ constexpr reference_wrapper(const reference_wrapper& x) noexcept;
27
  ```
28
 
29
  *Effects:* Constructs a `reference_wrapper` object that stores a
30
  reference to `x.get()`.
31