|
cppcore
A small, portable C++ core library
|
This class is used to describe a value which is not valid until it will ge inited. More...
#include <TOptional.h>
Public Member Functions | |
| TOptional ()=delete | |
| The default class constructor is deleted. | |
| TOptional (T defaultValue) | |
| The class constructor. | |
| ~TOptional ()=default | |
| The class destructor. | |
| bool | isInited () const |
| Will return false, if the value was not set,. | |
| T | value () |
| Will return the value or the default value if no init was performed before. | |
| void | set (T value) |
| Will set the value, the instance will be in init state true afterwards. | |
| T & | operator= (const T &value) |
| Default operators. | |
| bool | operator== (const TOptional< T > &rhs) const |
| The copy constructor. | |
This class is used to describe a value which is not valid until it will ge inited.
Definition at line 36 of file TOptional.h.
|
delete |
The default class constructor is deleted.
Referenced by operator==(), and ~TOptional().
|
inlineexplicit |
The class constructor.
| [in] | defaultValue | Init value if no set was performed. |
Definition at line 72 of file TOptional.h.
|
default |
The class destructor.
References TOptional(), and value().
|
inline |
Will return false, if the value was not set,.
Definition at line 77 of file TOptional.h.
|
inline |
|
inline |
|
inline |
Will set the value, the instance will be in init state true afterwards.
| [in] | value | The value. |
Definition at line 91 of file TOptional.h.
References value().
|
inline |
Will return the value or the default value if no init was performed before.
Definition at line 82 of file TOptional.h.
Referenced by operator=(), set(), and ~TOptional().