Iros
 
Loading...
Searching...
No Matches
di::MovableBox< T > Class Template Reference

#include <di/util/movable_box.h>

Public Member Functions

 MovableBox ()=default
 
 MovableBox (MovableBox const &)=delete
 
constexpr MovableBox (MovableBox &&)
 
template<typename... Args>
requires (concepts::ConstructibleFrom<T, Args...>)
constexpr MovableBox (types::InPlace, Args &&... args)
 
auto operator= (MovableBox const &) -> MovableBox &=delete
 
auto operator= (MovableBox &&) -> MovableBox &=delete
 
constexpr auto value () &-> T &
 
constexpr auto value () const &-> T const &
 
constexpr auto value () &&-> T &&
 
constexpr auto value () const &&-> T const &&
 

Detailed Description

MovableBox takes a non-movable default constructible type T and allows it to be move constructed, by defaulting the new T.

This is intended to be used by objects which internally use a mutex or atomic variable, but need to be movable so that they can be passed through an Expected<>.

Constructor & Destructor Documentation

◆ MovableBox() [1/4]

template<concepts::DefaultConstructible T>
di::util::MovableBox< T >::MovableBox ( )
default

◆ MovableBox() [2/4]

template<concepts::DefaultConstructible T>
di::util::MovableBox< T >::MovableBox ( MovableBox< T > const & )
delete

◆ MovableBox() [3/4]

template<concepts::DefaultConstructible T>
di::util::MovableBox< T >::MovableBox ( MovableBox< T > && )
inlineconstexpr

◆ MovableBox() [4/4]

template<concepts::DefaultConstructible T>
template<typename... Args>
requires (concepts::ConstructibleFrom<T, Args...>)
di::util::MovableBox< T >::MovableBox ( types::InPlace ,
Args &&... args )
inlineexplicitconstexpr

Member Function Documentation

◆ operator=() [1/2]

template<concepts::DefaultConstructible T>
auto di::util::MovableBox< T >::operator= ( MovableBox< T > && ) -> MovableBox &=delete
delete

◆ operator=() [2/2]

template<concepts::DefaultConstructible T>
auto di::util::MovableBox< T >::operator= ( MovableBox< T > const & ) -> MovableBox &=delete
delete

◆ value() [1/4]

template<concepts::DefaultConstructible T>
auto di::util::MovableBox< T >::value ( ) && -> T&&
inlineconstexpr

◆ value() [2/4]

template<concepts::DefaultConstructible T>
auto di::util::MovableBox< T >::value ( ) & -> T&
inlineconstexpr

◆ value() [3/4]

template<concepts::DefaultConstructible T>
auto di::util::MovableBox< T >::value ( ) const && -> T const&&
inlineconstexpr

◆ value() [4/4]

template<concepts::DefaultConstructible T>
auto di::util::MovableBox< T >::value ( ) const & -> T const&
inlineconstexpr

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