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 47 of file C4AulDefFunc.h.

Constructor & Destructor Documentation

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

Definition at line 52 of file C4AulDefFunc.h.

52 : _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 53 of file C4AulDefFunc.h.

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

Definition at line 54 of file C4AulDefFunc.h.

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

Definition at line 55 of file C4AulDefFunc.h.

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

Definition at line 56 of file C4AulDefFunc.h.

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

Member Function Documentation

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

Definition at line 57 of file C4AulDefFunc.h.

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

Definition at line 58 of file C4AulDefFunc.h.

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

Definition at line 72 of file C4AulDefFunc.h.

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

Definition at line 73 of file C4AulDefFunc.h.

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

Definition at line 74 of file C4AulDefFunc.h.

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

Definition at line 75 of file C4AulDefFunc.h.

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

Definition at line 59 of file C4AulDefFunc.h.

References C4Value::IsNullableType().

60  {
61  _val = val;
63  return *this;
64  }
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 65 of file C4AulDefFunc.h.

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

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