OpenMiner  0.0.1a
Voxel game engine
Public Member Functions | Private Attributes | List of all members
sol::optional< T & > Class Template Reference

#include <sol.hpp>

Public Member Functions

constexpr optional () noexcept
 
constexpr optional (nullopt_t) noexcept
 
constexpr optional (T &v) noexcept
 
 optional (T &&)=delete
 
constexpr optional (const optional &rhs) noexcept
 
constexpr optional (in_place_t, T &v) noexcept
 
 optional (in_place_t, T &&)=delete
 
 ~optional ()=default
 
optionaloperator= (nullopt_t) noexcept
 
template<typename U >
auto operator= (U &&rhs) noexcept -> typename ::std::enable_if< ::std::is_same< typename ::std::decay< U >::type, optional< T &>>::value, optional &>::type
 
template<typename U >
auto operator= (U &&rhs) noexcept -> typename ::std::enable_if< !::std::is_same< typename ::std::decay< U >::type, optional< T &>>::value, optional &>::type=delete
 
void emplace (T &v) noexcept
 
void emplace (T &&)=delete
 
void swap (optional< T &> &rhs) noexcept
 
constexpr Toperator-> () const
 
constexpr Toperator* () const
 
constexpr Tvalue () const
 
constexpr operator bool () const noexcept
 
template<typename V >
constexpr Tvalue_or (V &&v) const
 

Private Attributes

Tref
 

Constructor & Destructor Documentation

§ optional() [1/7]

template<class T >
constexpr sol::optional< T & >::optional ( )
inlinenoexcept
3951  : ref(nullptr) {
3952  }

§ optional() [2/7]

template<class T >
constexpr sol::optional< T & >::optional ( nullopt_t  )
inlinenoexcept
3955  : ref(nullptr) {
3956  }

§ optional() [3/7]

template<class T >
constexpr sol::optional< T & >::optional ( T v)
inlinenoexcept
3959  : ref(detail_::static_addressof(v)) {
3960  }
constexpr T * static_addressof(T &ref)
Definition: sol.hpp:3472

§ optional() [4/7]

template<class T >
sol::optional< T & >::optional ( T &&  )
delete

§ optional() [5/7]

template<class T >
constexpr sol::optional< T & >::optional ( const optional< T & > &  rhs)
inlinenoexcept
3965  : ref(rhs.ref) {
3966  }

§ optional() [6/7]

template<class T >
constexpr sol::optional< T & >::optional ( in_place_t  ,
T v 
)
inlineexplicitnoexcept
3969  : ref(detail_::static_addressof(v)) {
3970  }
constexpr T * static_addressof(T &ref)
Definition: sol.hpp:3472

§ optional() [7/7]

template<class T >
sol::optional< T & >::optional ( in_place_t  ,
T &&   
)
explicitdelete

§ ~optional()

template<class T >
sol::optional< T & >::~optional ( )
default

Member Function Documentation

§ emplace() [1/2]

template<class T >
void sol::optional< T & >::emplace ( T v)
inlinenoexcept
4007  {
4008  ref = detail_::static_addressof(v);
4009  }
constexpr T * static_addressof(T &ref)
Definition: sol.hpp:3472

§ emplace() [2/2]

template<class T >
void sol::optional< T & >::emplace ( T &&  )
delete

§ operator bool()

template<class T >
constexpr sol::optional< T & >::operator bool ( ) const
inlineexplicitnoexcept
4035  {
4036  return ref != nullptr;
4037  }

§ operator*()

template<class T >
constexpr T& sol::optional< T & >::operator* ( ) const
inline
4022  {
4023  return TR2_OPTIONAL_ASSERTED_EXPRESSION(ref, *ref);
4024  }
#define TR2_OPTIONAL_ASSERTED_EXPRESSION(CHECK, EXPR)
Definition: sol.hpp:3450

§ operator->()

template<class T >
constexpr T* sol::optional< T & >::operator-> ( ) const
inline
4018  {
4019  return TR2_OPTIONAL_ASSERTED_EXPRESSION(ref, ref);
4020  }
#define TR2_OPTIONAL_ASSERTED_EXPRESSION(CHECK, EXPR)
Definition: sol.hpp:3450

§ operator=() [1/3]

template<class T >
optional& sol::optional< T & >::operator= ( nullopt_t  )
inlinenoexcept
3977  {
3978  ref = nullptr;
3979  return *this;
3980  }

§ operator=() [2/3]

template<class T >
template<typename U >
auto sol::optional< T & >::operator= ( U &&  rhs) -> typename ::std::enable_if< ::std::is_same<typename ::std::decay<U>::type, optional<T&>>::value, optional&>::type
inlinenoexcept
3996  {
3997  ref = rhs.ref;
3998  return *this;
3999  }

§ operator=() [3/3]

template<class T >
template<typename U >
auto sol::optional< T & >::operator= ( U &&  rhs) -> typename ::std::enable_if< !::std::is_same< typename ::std::decay< U >::type, optional< T &>>::value, optional &>::type=delete
deletenoexcept

§ swap()

template<class T >
void sol::optional< T & >::swap ( optional< T &> &  rhs)
inlinenoexcept
4013  {
4014  ::std::swap(ref, rhs.ref);
4015  }
void swap(optional< T > &x, optional< T > &y) noexcept(noexcept(x.swap(y)))
Definition: sol.hpp:4327

§ value()

template<class T >
constexpr T& sol::optional< T & >::value ( ) const
inline
4026  {
4027 #ifdef SOL_NO_EXCEPTIONS
4028  return *ref;
4029 #else
4030  return ref ? *ref
4031  : (throw bad_optional_access("bad optional access"), *ref);
4032 #endif // Exceptions
4033  }

§ value_or()

template<class T >
template<typename V >
constexpr T& sol::optional< T & >::value_or ( V &&  v) const
inline
4040  {
4041  return *this ? **this : detail_::convert<T&>(constexpr_forward<V>(v));
4042  }

Member Data Documentation

§ ref

template<class T >
T* sol::optional< T & >::ref
private

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