Function move

Summary

#include <include/type_safe/optional_ref.hpp>

(1) template <typename T>
    optional< T > move(const optional_xvalue_ref< T > &ref) noexcept(std::is_nothrow_move_constructible< T >::value)

#include <include/type_safe/reference.hpp>

(2) template <typename T>
    constexpr T move(const xvalue_ref< T > &obj) noexcept(std::is_nothrow_move_constructible< T >::value)

#include <include/type_safe/tagged_union.hpp>

(3) template <typename... Types>
    void move(tagged_union< Types... > &dest, tagged_union< Types... > &&org)

Function overload

Synopsis

#include <include/type_safe/optional_ref.hpp>

template <typename T>
optional< T > move(const optional_xvalue_ref< T > &ref) noexcept(std::is_nothrow_move_constructible< T >::value)

Description

Returns
A [ts::optional<T>]() containing a copy of the value of ref created by move constructing if there is any value. \requires T must be moveable. \module optional

Source

Lines 271-276 in include/type_safe/optional_ref.hpp.

template <typename T>
optional<T> move(const optional_xvalue_ref<T>& ref) noexcept(
    std::is_nothrow_move_constructible<T>::value)
{
    return ref.has_value() ? type_safe::make_optional(ref.value()) : nullopt;
}

Synopsis

#include <include/type_safe/reference.hpp>

template <typename T>
constexpr T move(const xvalue_ref< T > &obj) noexcept(std::is_nothrow_move_constructible< T >::value)

Description

\group object_ref_copy

Source

Lines 265-269 in include/type_safe/reference.hpp.

template <typename T>
constexpr T move(const xvalue_ref<T>& obj) noexcept(std::is_nothrow_move_constructible<T>::value)
{
    return *obj;
}

Synopsis

#include <include/type_safe/tagged_union.hpp>

template <typename... Types>
void move(tagged_union< Types... > &dest, tagged_union< Types... > &&org)

Description

\group union_copy_move \module variant \unique_name *move_union

Source

Lines 451-456 in include/type_safe/tagged_union.hpp.

template <typename... Types>
void move(tagged_union<Types...>& dest, tagged_union<Types...>&& org)
{
    DEBUG_ASSERT(!dest.has_value(), detail::precondition_error_handler{});
    detail::move_union<tagged_union<Types...>>::move(dest, std::move(org));
}





Add Discussion as Guest

Log in