OpenClonk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
Nillable< T > Singleton Reference

#include <C4AulDefFunc.h>

Public Member Functions

 Nillable (const T &value)
 
 Nillable ()
 
 Nillable (std::nullptr_t)
 
template<typename T2 >
 Nillable (const Nillable< T2 > &n2)
 
 Nillable (const C4Void &)
 
bool IsNil () const
 
 operator T () const
 
Nillable< T > & operator= (const T &val)
 
Nillable< T > & operator= (const Nillable< T > &val)
 
Nillable< T > & operator++ ()
 
operator++ (int)
 
Nillable< T > & operator-- ()
 
operator-- (int)
 

Detailed Description

template<typename T>
singleton Nillable< T >

Definition at line 48 of file C4AulDefFunc.h.

Constructor & Destructor Documentation

template<typename T>
Nillable< T >::Nillable ( const T &  value)
inline

Definition at line 53 of file C4AulDefFunc.h.

53 : _nil(!value && !C4Value::IsNullableType(C4ValueConv<T>::Type)), _val(value) {}
static constexpr bool IsNullableType(C4V_Type Type)
Definition: C4Value.h:212
template<typename T>
Nillable< T >::Nillable ( )
inline

Definition at line 54 of file C4AulDefFunc.h.

54 : _nil(true), _val(T()) {}
template<typename T>
Nillable< T >::Nillable ( std::nullptr_t  )
inline

Definition at line 55 of file C4AulDefFunc.h.

55 : _nil(true), _val(T()) {}
template<typename T>
template<typename T2 >
Nillable< T >::Nillable ( const Nillable< T2 > &  n2)
inline

Definition at line 56 of file C4AulDefFunc.h.

56 : _nil(n2._nil), _val(n2._val) {}
template<typename T>
Nillable< T >::Nillable ( const C4Void )
inline

Definition at line 57 of file C4AulDefFunc.h.

57 : _nil(true), _val(T()) {}

Member Function Documentation

template<typename T>
bool Nillable< T >::IsNil ( ) const
inline

Definition at line 58 of file C4AulDefFunc.h.

58 { return _nil; }
template<typename T>
Nillable< T >::operator T ( ) const
inline

Definition at line 59 of file C4AulDefFunc.h.

59 { return _val; }
template<typename T>
Nillable<T>& Nillable< T >::operator++ ( )
inline

Definition at line 73 of file C4AulDefFunc.h.

73 { ++_val; return *this; }
template<typename T>
T Nillable< T >::operator++ ( int  )
inline

Definition at line 74 of file C4AulDefFunc.h.

74 { T v(_val++); return v; }
template<typename T>
Nillable<T>& Nillable< T >::operator-- ( )
inline

Definition at line 75 of file C4AulDefFunc.h.

75 { --_val; return *this; }
template<typename T>
T Nillable< T >::operator-- ( int  )
inline

Definition at line 76 of file C4AulDefFunc.h.

76 { T v(_val--); return v; }
template<typename T>
Nillable<T>& Nillable< T >::operator= ( const T &  val)
inline

Definition at line 60 of file C4AulDefFunc.h.

References C4Value::IsNullableType().

61  {
62  _val = val;
64  return *this;
65  }
static constexpr bool IsNullableType(C4V_Type Type)
Definition: C4Value.h:212

Here is the call graph for this function:

template<typename T>
Nillable<T>& Nillable< T >::operator= ( const Nillable< T > &  val)
inline

Definition at line 66 of file C4AulDefFunc.h.

67  {
68  _val = val._val;
69  _nil = val._nil;
70  return *this;
71  }

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