Seastar
High performance C++ framework for concurrent servers
|
optimized_optional<>
is intended mainly for use with classes that store their data externally and expect pointer to this data to be always non-null. In such case there is no real need for another flag signifying whether the optional is engaged.
#include <seastar/util/optimized_optional.hh>
Public Member Functions | |
optimized_optional (std::nullopt_t) noexcept | |
optimized_optional (const T &obj) | |
optimized_optional (T &&obj) noexcept | |
optimized_optional (std::optional< T > &&obj) noexcept | |
optimized_optional (const optimized_optional &)=default | |
optimized_optional (optimized_optional &&)=default | |
optimized_optional & | operator= (std::nullopt_t) noexcept |
template<typename U > | |
std::enable_if_t< std::is_same_v< std::decay_t< U >, T >, optimized_optional & > | operator= (U &&obj) noexcept |
optimized_optional & | operator= (const optimized_optional &)=default |
optimized_optional & | operator= (optimized_optional &&)=default |
operator bool () const noexcept | |
T * | operator-> () noexcept |
const T * | operator-> () const noexcept |
T & | operator* () noexcept |
const T & | operator* () const noexcept |
bool | operator== (const optimized_optional &other) const |
bool | operator!= (const optimized_optional &other) const |