Public Types | |
typedef optional< T & > | _self_type |
Type for the optional class itself. More... | |
Public Member Functions | |
constexpr | optional (std::nullptr_t) |
Create a disengaged object. More... | |
constexpr | optional () |
Default constructor. More... | |
optional (T &other) | |
Create an engaged object by moving other content. More... | |
optional (_self_type const &other)=default | |
Copy constructor. More... | |
_self_type & | operator= (_self_type const &other)=default |
Assign new content to the object. More... | |
void | disengage () |
Disengage the object, destroying the current contained value, if any. | |
operator bool () const | |
Convert to bool based on whether the object is engaged or not. More... | |
bool | operator! () const |
Convert to bool based on whether the object is engaged or not. More... | |
T * | operator-> () |
Access member of the contained value. More... | |
T const * | operator-> () const |
Access constant member of the contained value. More... | |
T & | operator* () |
Get the contained value. More... | |
T const & | operator* () const |
Get the contained value. More... | |
T & | get () |
Get the contained value. More... | |
T const & | get () const |
Get the contained value. More... | |
void | swap (optional< T > &other) |
Swap content with another eina::optional object. More... | |
bool | is_engaged () const |
Check if the object is engaged. More... | |
typedef optional<T&> efl::eina::optional< T & >::_self_type |
Type for the optional class itself.
|
inline |
Create a disengaged object.
This constructor creates a disengaged eina::optional
object.
|
inline |
Default constructor.
Create a disengaged object.
|
inline |
Create an engaged object by moving other
content.
other | R-value reference to the desired type. |
This constructor creates an eina::optional
object in an engaged state. The contained value is initialized by moving other
.
|
default |
Copy constructor.
Create an object containing the same value as other
and in the same state.
other | Constant reference to another eina::optional object that holds the same value type. |
This constructor creates an eina::optional
object with the same engagement state of other
. If other
is engaged then the contained value of the newly created object is initialized by copying the contained value of other
.
|
default |
Assign new content to the object.
other | Constant reference to another eina::optional object that holds the same value type. |
This operator replaces the current content of the object. If other
is engaged its contained value is copied to this object, making *this
be considered engaged too. If other
is disengaged *this
is also made disengaged and its contained value, if any, is simple destroyed.
|
inlineexplicit |
Convert to bool
based on whether the object is engaged or not.
true
if the object is engaged, false
otherwise.
|
inline |
Convert to bool
based on whether the object is engaged or not.
true
if the object is disengaged, false
otherwise.
|
inline |
Access member of the contained value.
|
inline |
Access constant member of the contained value.
|
inline |
Get the contained value.
|
inline |
Get the contained value.
|
inline |
Get the contained value.
|
inline |
Get the contained value.
|
inline |
Swap content with another eina::optional
object.
other | Another eina::optional object. |
References efl::eina::swap().
|
inline |
Check if the object is engaged.
true
if the object is currently engaged, false
otherwise.