◆ Optional() [1/9]
Default constructor creating an unset optional.
◆ Optional() [2/9]
Constructor from value creating a set optional.
◆ Optional() [3/9]
Constructor from r-value creating a set optional.
◆ Optional() [4/9]
◆ Optional() [5/9]
◆ Optional() [6/9]
Constructor from null value creating an unset optional.
◆ Optional() [7/9]
In-place constructor forwarding arguments to T's constructor.
◆ Optional() [8/9]
template<typename T >
template<typename U >
Constructor from a value of different type U that's convertible to T.
◆ Optional() [9/9]
template<typename T >
template<typename U >
Constructor from different optional type containing a value of type U that's convertible to T.
◆ ~Optional()
◆ hasValue()
Returns true if the optional is set.
◆ operator*() [1/4]
Returns the contained value.
- Exceptions
-
◆ operator*() [2/4]
Returns the contained value.
- Exceptions
-
◆ operator*() [3/4]
Returns the contained value.
- Exceptions
-
◆ operator*() [4/4]
Returns the contained value.
- Exceptions
-
◆ operator->() [1/4]
Returns a pointer to the contained value.
- Exceptions
-
◆ operator->() [2/4]
Returns a pointer to the contained value.
- Exceptions
-
◆ operator->() [3/4]
Returns a pointer to the contained value.
- Exceptions
-
◆ operator->() [4/4]
Returns a pointer to the contained value.
- Exceptions
-
◆ operator=() [1/6]
Copy assignment operator.
◆ operator=() [2/6]
template<typename T >
template<typename U >
Assigns from a value of different optional type containing a value of type U that's convertible to T.
◆ operator=() [3/6]
Assigns from null value, resetting the optional.
◆ operator=() [4/6]
Move assignment operator.
◆ operator=() [5/6]
template<typename T >
template<typename U >
Assigns from a different optional type containing a value of type U that's convertible to T.
◆ operator=() [6/6]
template<typename T >
template<typename U >
Assigns from a value of different type U that's convertible to T.
◆ tryValue()
Returns the contained value or throws optional::Unset if not set.
Note that this method differs from value() in that it throws a different exception that's not derived from RuntimeError. This is for catching accesses to a unset optional that are deemed legitimate within the caller's context.
◆ value() [1/4]
Returns the contained value.
- Exceptions
-
◆ value() [2/4]
Returns the contained value.
- Exceptions
-
◆ value() [3/4]
Returns the contained value.
- Exceptions
-
◆ value() [4/4]
Returns the contained value.
- Exceptions
-
◆ valueOr()
Returns the contained value or a default if not set.
◆ valueOrInit() [1/2]
Returns the contained value, potentially first initializing it with a default-constructed value if not already set.
◆ valueOrInit() [2/2]
Returns the contained value, potentially first initializing it with a default if not already set.
- Parameters
-
| default_ | the default value to initialize with if not set yet |
The documentation for this class was generated from the following files:
- /home/docs/checkouts/readthedocs.org/user_builds/spicy-docs/checkouts/latest/hilti/runtime/include/types/null.h
- /home/docs/checkouts/readthedocs.org/user_builds/spicy-docs/checkouts/latest/hilti/runtime/include/types/optional.h