|
HikoGUI
A low latency retained GUI
|
#include <ttauri/polymorphic_optional.hpp>
Public Types | |
| using | value_type = BaseType |
| using | reference = value_type & |
| using | const_reference = value_type const & |
| using | pointer = value_type * |
| using | const_pointer = value_type const * |
Public Member Functions | |
| ~polymorphic_optional () | |
| Destroy any contained value. | |
| polymorphic_optional (polymorphic_optional const &other)=delete | |
| polymorphic_optional (polymorphic_optional &&other)=delete | |
| polymorphic_optional & | operator= (polymorphic_optional const &other)=delete |
| polymorphic_optional & | operator= (polymorphic_optional &&other)=delete |
| constexpr | polymorphic_optional () noexcept |
| Construct an empty value. | |
| template<typename Other > requires (is_different_v<Other, value_type>) | |
| polymorphic_optional (Other &&other) noexcept | |
| Construct an object as value. | |
| template<decayed_derived_from< value_type > Other> | |
| polymorphic_optional & | operator= (Other &&other) noexcept |
| Assign an object. | |
| template<derived_from< value_type > T, typename... Args> | |
| reference | emplace (Args &&...args) noexcept |
| Construct the contained value in-place. | |
| bool | has_value () const noexcept |
| Check whether the object contains a value. | |
| operator bool () const noexcept | |
| Check whether the object contains a value. | |
| void | reset () noexcept |
| Destroys any contained value. | |
| const_reference | value () const &noexcept |
| Returns the contained value. | |
| reference | value () &noexcept |
| Returns the contained value. | |
| const_reference | operator* () const noexcept |
| Dereference the contained value. | |
| reference | operator* () noexcept |
| Dereference the contained value. | |
| const_pointer | operator-> () const noexcept |
| Get a pointer to the contained value. | |
| pointer | operator-> () noexcept |
| Get a pointer to the contained value. | |
Static Public Attributes | |
| static constexpr size_t | capacity = Capacity |
Polymorphic optional.
This optional container can hold an polymorphic value.
If the assigned sub-class is larger than the internal buffer the object will be allocated on the heap.
| BaseType | The base type of the polymorphic value. |
| Capacity | The size in bytes of the internal buffer to store the polymorphic value. |
|
inline |
Destroy any contained value.
|
inlineconstexprnoexcept |
Construct an empty value.
|
inlinenoexcept |
Construct an object as value.
| other | An object of a sub-class of the value_type. |
|
inlinenoexcept |
Construct the contained value in-place.
| T | The sub-class of value_type to construct. |
| args | The arguments used to construct the object of type O. |
|
inlinenoexcept |
Check whether the object contains a value.
|
inlinenoexcept |
Check whether the object contains a value.
|
inlinenoexcept |
Dereference the contained value.
It is undefined behaviour to derefence if this does not contain a value.
|
inlinenoexcept |
Dereference the contained value.
It is undefined behaviour to derefence if this does not contain a value.
|
inlinenoexcept |
Get a pointer to the contained value.
|
inlinenoexcept |
Get a pointer to the contained value.
|
inlinenoexcept |
Assign an object.
| other | An object of a sub-class of the value_type. |
|
inlinenoexcept |
Destroys any contained value.
|
inlinenoexcept |
Returns the contained value.
| std::bad_optional_access | when this does not contain a value. |
|
inlinenoexcept |
Returns the contained value.
| std::bad_optional_access | when this does not contain a value. |