OpenMiner  0.0.1a
Voxel game engine
Public Member Functions | Public Attributes | List of all members
sol::optional_base< T > Struct Template Reference

#include <sol.hpp>

Public Member Functions

constexpr optional_base () noexcept
 
 optional_base (const T &v)
 
 optional_base (T &&v)
 
template<class... Args>
 optional_base (in_place_t, Args &&... args)
 
template<class U , class... Args, TR2_OPTIONAL_REQUIRES(::std::is_constructible< T, ::std::initializer_list< U >>) >
 optional_base (in_place_t, ::std::initializer_list< U > il, Args &&... args)
 
Tstorage ()
 
constexpr const Tstorage () const
 
 ~optional_base ()
 

Public Attributes

char storage_ [sizeof(T)]
 
bool init_
 

Constructor & Destructor Documentation

§ optional_base() [1/5]

template<class T>
constexpr sol::optional_base< T >::optional_base ( )
inlinenoexcept
3517  : storage_(), init_(false){};
char storage_[sizeof(T)]
Definition: sol.hpp:3513
bool init_
Definition: sol.hpp:3514

§ optional_base() [2/5]

template<class T>
sol::optional_base< T >::optional_base ( const T v)
inlineexplicit
3520  : storage_(), init_(true) {
3521  new (&storage()) T(v);
3522  }
char storage_[sizeof(T)]
Definition: sol.hpp:3513
T & storage()
Definition: sol.hpp:3544
bool init_
Definition: sol.hpp:3514

§ optional_base() [3/5]

template<class T>
sol::optional_base< T >::optional_base ( T &&  v)
inlineexplicit
3525  : storage_(), init_(true) {
3526  new (&storage()) T(constexpr_move(v));
3527  }
constexpr ::std::remove_reference< T >::type && constexpr_move(T &&t) noexcept
Definition: sol.hpp:3443
char storage_[sizeof(T)]
Definition: sol.hpp:3513
T & storage()
Definition: sol.hpp:3544
bool init_
Definition: sol.hpp:3514

§ optional_base() [4/5]

template<class T>
template<class... Args>
sol::optional_base< T >::optional_base ( in_place_t  ,
Args &&...  args 
)
inlineexplicit
3531  : init_(true), storage_() {
3532  new (&storage()) T(constexpr_forward<Args>(args)...);
3533  }
char storage_[sizeof(T)]
Definition: sol.hpp:3513
T & storage()
Definition: sol.hpp:3544
bool init_
Definition: sol.hpp:3514

§ optional_base() [5/5]

template<class T>
template<class U , class... Args, TR2_OPTIONAL_REQUIRES(::std::is_constructible< T, ::std::initializer_list< U >>) >
sol::optional_base< T >::optional_base ( in_place_t  ,
::std::initializer_list< U >  il,
Args &&...  args 
)
inlineexplicit
3537  : init_(true), storage_() {
3538  new (&storage()) T(il, constexpr_forward<Args>(args)...);
3539  }
char storage_[sizeof(T)]
Definition: sol.hpp:3513
T & storage()
Definition: sol.hpp:3544
bool init_
Definition: sol.hpp:3514

§ ~optional_base()

template<class T>
sol::optional_base< T >::~optional_base ( )
inline
3555  {
3556  if (init_) {
3557  storage().T::~T();
3558  }
3559  }
T & storage()
Definition: sol.hpp:3544
bool init_
Definition: sol.hpp:3514

Member Function Documentation

§ storage() [1/2]

template<class T>
T& sol::optional_base< T >::storage ( )
inline
3544  {
3545  return *reinterpret_cast<T*>(&storage_[0]);
3546  }
char storage_[sizeof(T)]
Definition: sol.hpp:3513

§ storage() [2/2]

template<class T>
constexpr const T& sol::optional_base< T >::storage ( ) const
inline
3548  {
3549  return *reinterpret_cast<T const*>(&storage_[0]);
3550  }
char storage_[sizeof(T)]
Definition: sol.hpp:3513

Member Data Documentation

§ init_

template<class T>
bool sol::optional_base< T >::init_

§ storage_

template<class T>
char sol::optional_base< T >::storage_[sizeof(T)]

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