|
MSTL 1.4.0
A Modern C++ Library with extended functionality, web components, and utility libraries
|
引用包装器类模板 更多...
#include <reference_wrapper.hpp>
Public 类型 | |
| using | type = T |
| 包装的类型 | |
Public 成员函数 | |
| template<typename U, enable_if_t< conjunction< negation< is_same< remove_cvref_t< U >, reference_wrapper > >, _INNER ref_wrapper_constructable_from< T, U > >::value, int > = 0> | |
| MSTL_CONSTEXPR14 | reference_wrapper (U &&x) noexcept(noexcept(_INNER __ref_wrapper_construct_aux< T >(_MSTL declval< U >()))) |
| 构造函数 | |
| MSTL_CONSTEXPR14 | operator T& () const noexcept |
| 隐式转换运算符 | |
| MSTL_NODISCARD MSTL_CONSTEXPR14 T & | get () const noexcept |
| 获取包装的引用 | |
| template<typename... Args> | |
| MSTL_CONSTEXPR14 _INNER __invoke_result_aux< T &, Args... >::type | operator() (Args &&... args) const noexcept(is_nothrow_invocable< T &, Args... >::value) |
| 函数调用运算符 | |
引用包装器类模板
| T | 被包装的类型 |
将引用包装为可复制的值类型,可以在容器中存储引用。
支持隐式转换为原始引用,以及函数调用运算符。
在文件 reference_wrapper.hpp 第 62 行定义.
|
inlinenoexcept |
构造函数
| U | 源类型 |
| x | 要包装的引用 |
从任意可以转换为T引用的类型构造引用包装器。 禁止从右值构造,防止悬垂引用。
在文件 reference_wrapper.hpp 第 84 行定义.
引用了 _INNER, _MSTL, addressof(), declval() , 以及 ref().
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |