Sunshine master
Self-hosted game stream host for Moonlight.
move_by_copy_util::MoveByCopy< T > Class Template Reference

#include <src/move_by_copy.h>

Public Types

typedef T move_type
 Wrapped type moved through copy-shaped APIs.
 

Public Member Functions

 MoveByCopy (const MoveByCopy &other)
 Copy by moving the stored object out of another wrapper.
 
 MoveByCopy (move_type &&to_move)
 Store a move-only value for transfer through copy-only call sites.
 
 MoveByCopy (MoveByCopy &&other)=default
 Move the stored object from another wrapper.
 
 operator move_type ()
 Move the wrapped object out of this helper.
 
MoveByCopyoperator= (const MoveByCopy &other)
 Copy-assign by moving the wrapped object out of the source wrapper.
 
MoveByCopyoperator= (MoveByCopy &&other)=default
 Move-assign the wrapped object from another wrapper.
 

Detailed Description

template<class T>
class move_by_copy_util::MoveByCopy< T >

When a copy is made, it moves the object This allows you to move an object when a move can't be done.

Constructor & Destructor Documentation

◆ MoveByCopy() [1/3]

template<class T >
move_by_copy_util::MoveByCopy< T >::MoveByCopy ( move_type && to_move)
inlineexplicit

Store a move-only value for transfer through copy-only call sites.

Parameters
to_moveObject whose ownership is moved into this wrapper.

◆ MoveByCopy() [2/3]

template<class T >
move_by_copy_util::MoveByCopy< T >::MoveByCopy ( MoveByCopy< T > && other)
default

Move the stored object from another wrapper.

Parameters
otherWrapper whose stored object is moved into this object.

◆ MoveByCopy() [3/3]

template<class T >
move_by_copy_util::MoveByCopy< T >::MoveByCopy ( const MoveByCopy< T > & other)
inline

Copy by moving the stored object out of another wrapper.

Parameters
otherWrapper whose stored object will be moved despite the copy signature.

Member Function Documentation

◆ operator=() [1/2]

template<class T >
MoveByCopy & move_by_copy_util::MoveByCopy< T >::operator= ( const MoveByCopy< T > & other)
inline

Copy-assign by moving the wrapped object out of the source wrapper.

Parameters
otherSource object whose state is copied or moved into this object.
Returns
Reference to this wrapper.

◆ operator=() [2/2]

template<class T >
MoveByCopy & move_by_copy_util::MoveByCopy< T >::operator= ( MoveByCopy< T > && other)
default

Move-assign the wrapped object from another wrapper.

Parameters
otherSource object whose state is copied or moved into this object.
Returns
Reference to this wrapper.

The documentation for this class was generated from the following file: