Lines Matching full:optional

35 #include "utils/optional.hpp"
39 /// Initializes an optional object to the none value.
41 utils::optional< T >::optional(void) :
47 /// Explicitly initializes an optional object to the none value.
49 utils::optional< T >::optional(utils::detail::none_t /* none */) :
55 /// Initializes an optional object to a non-none value.
59 utils::optional< T >::optional(const T& data) :
67 /// \param other The optional object to copy from.
69 utils::optional< T >::optional(const optional< T >& other) :
77 utils::optional< T >::~optional(void)
85 /// Explicitly assigns an optional object to the none value.
89 utils::optional< T >&
90 utils::optional< T >::operator=(utils::detail::none_t /* none */)
99 /// Assigns a new value to the optional object.
105 utils::optional< T >&
106 utils::optional< T >::operator=(const T& data)
116 /// Copies an optional value.
118 /// \param other The optional object to copy from.
122 utils::optional< T >&
123 utils::optional< T >::operator=(const optional< T >& other)
140 utils::optional< T >::operator==(const optional< T >& other) const
160 utils::optional< T >::operator!=(const optional< T >& other) const
166 /// Gets the value hold by the optional object.
168 /// \pre The optional object must not be none.
173 utils::optional< T >::get(void) const
184 /// \return A reference to the data in the optional object, or the reference
188 utils::optional< T >::get_default(const T& default_value) const
197 /// Tests whether the optional object contains data or not.
201 utils::optional< T >::operator bool(void) const
207 /// Tests whether the optional object contains data or not.
212 utils::optional< T >::get(void)
227 const optional< T >& object)
238 /// Helper function to instantiate optional objects.
240 /// \param value The value for the optional object. Shouldn't be none, as
241 /// optional objects can be constructed from none right away.
243 /// \return A new optional object.
245 utils::optional< T >
248 return optional< T >(value);