tmp/tmpmwr3e_eo/{from.md → to.md}
RENAMED
|
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#### General <a id="refwrap.general">[[refwrap.general]]</a>
|
| 2 |
+
|
| 3 |
+
``` cpp
|
| 4 |
+
namespace std {
|
| 5 |
+
template<class T> class reference_wrapper {
|
| 6 |
+
public:
|
| 7 |
+
// types
|
| 8 |
+
using type = T;
|
| 9 |
+
|
| 10 |
+
// [refwrap.const], constructors
|
| 11 |
+
template<class U>
|
| 12 |
+
constexpr reference_wrapper(U&&) noexcept(see below);
|
| 13 |
+
constexpr reference_wrapper(const reference_wrapper& x) noexcept;
|
| 14 |
+
|
| 15 |
+
// [refwrap.assign], assignment
|
| 16 |
+
constexpr reference_wrapper& operator=(const reference_wrapper& x) noexcept;
|
| 17 |
+
|
| 18 |
+
// [refwrap.access], access
|
| 19 |
+
constexpr operator T& () const noexcept;
|
| 20 |
+
constexpr T& get() const noexcept;
|
| 21 |
+
|
| 22 |
+
// [refwrap.invoke], invocation
|
| 23 |
+
template<class... ArgTypes>
|
| 24 |
+
constexpr invoke_result_t<T&, ArgTypes...> operator()(ArgTypes&&...) const
|
| 25 |
+
noexcept(is_nothrow_invocable_v<T&, ArgTypes...>);
|
| 26 |
+
};
|
| 27 |
+
|
| 28 |
+
template<class T>
|
| 29 |
+
reference_wrapper(T&) -> reference_wrapper<T>;
|
| 30 |
+
}
|
| 31 |
+
```
|
| 32 |
+
|
| 33 |
+
`reference_wrapper<T>` is a *Cpp17CopyConstructible* and
|
| 34 |
+
*Cpp17CopyAssignable* wrapper around a reference to an object or
|
| 35 |
+
function of type `T`.
|
| 36 |
+
|
| 37 |
+
`reference_wrapper<T>` is a trivially copyable type
|
| 38 |
+
[[term.trivially.copyable.type]].
|
| 39 |
+
|
| 40 |
+
The template parameter `T` of `reference_wrapper` may be an incomplete
|
| 41 |
+
type.
|
| 42 |
+
|