Function move

Summary

#include <include/EASTL/internal/copy_help.h>

(1) template <typename InputIterator, typename OutputIterator>
    OutputIterator move(InputIterator first, InputIterator last, OutputIterator result)

#include <include/EASTL/internal/move_help.h>

(2) template <typename T>
    EA_CPP14_CONSTEXPR eastl::remove_reference< T >::type && move(T &&x) EA_NOEXCEPT

Function overload

Synopsis

#include <include/EASTL/internal/copy_help.h>

template <typename InputIterator, typename OutputIterator>
OutputIterator move(InputIterator first, InputIterator last, OutputIterator result)

Description

move

After this operation the elements in the moved-from range will still contain valid values of the appropriate type, but not necessarily the same values as before the move. Returns the end of the result range. Note: When moving between containers, the dest range must be valid; this function doesn't resize containers. Note: if result is within [first, last), move_backward must be used instead of move.

Example usage: eastl::move(myArray.begin(), myArray.end(), myDestArray.begin());

Reference implementation: template <typename InputIterator, typename OutputIterator> OutputIterator move(InputIterator first, InputIterator last, OutputIterator result) { while(first != last) *result++ = eastl::move(*first++); return result; }

Source

Lines 170-174 in include/EASTL/internal/copy_help.h.

template <typename InputIterator, typename OutputIterator>
inline OutputIterator move(InputIterator first, InputIterator last, OutputIterator result)
{
    return eastl::move_and_copy_unwrapper<true>(eastl::unwrap_iterator(first), eastl::unwrap_iterator(last), result);
}

Synopsis

#include <include/EASTL/internal/move_help.h>

template <typename T>
EA_CPP14_CONSTEXPR eastl::remove_reference< T >::type && move(T &&x) EA_NOEXCEPT

Description

move

move obtains an rvalue reference to its argument and converts it to an xvalue. Returns, by definition: static_cast<typename remove_reference<T>::type&&>(t). The primary use of this is to pass a move'd type to a function which takes T&&, and thus select that function instead of (e.g.) a function which takes T or T&. See the C++ Standard, section 20.2.3 http://en.cppreference.com/w/cpp/utility/move

Source

Lines 111-116 in include/EASTL/internal/move_help.h.

template <typename T>
EA_CPP14_CONSTEXPR typename eastl::remove_reference<T>::type&&
move(T&& x) EA_NOEXCEPT
{
    return static_cast<typename eastl::remove_reference<T>::type&&>(x);
}





Add Discussion as Guest

Log in