deref-move
From cppreference.com
template< class I >
constexpr decltype(auto) /*deref-move*/( I& iter )
|
(since C++17) (exposition only*) |
|
Returns the result of dereferencing iter as an rvalue:
- If
*iteris of an lvalue reference type, returnsstd::move(*iter). - Otherwise returns
*iterdirectly.
Parameters
| iter | - | the iterator for which the referred object will be moved |
Return value
As described above.
Notes
This exposition-only function template is introduced by the resolution of LWG issue 3918. It is used to prevent the unnecessary move construction from the result of dereferencing iter if the result is already an rvalue.
See also
(C++17) |
moves a range of objects to an uninitialized area of memory (function template & algorithm function object) |
(C++20) |
|
(C++17) |
moves a number of objects to an uninitialized area of memory (function template & algorithm function object) |
(C++20) |