146class IOX_NO_DISCARD expected<ErrorType>
164 template <
typename ValueType>
165 expected(
const expected<ValueType, ErrorType>& rhs)
noexcept;
169 template <
typename ValueType>
170 expected(expected<ValueType, ErrorType>&& rhs)
noexcept;
178 expected& operator=(const expected&) noexcept;
182 expected& operator=(expected&& rhs) noexcept;
187 template <
typename ValueType>
188 expected& operator=(
const expected<ValueType, ErrorType>& rhs)
noexcept;
192 template <
typename ValueType>
193 expected& operator=(expected<ValueType, ErrorType>&& rhs)
noexcept;
218 template <typename... Targs>
219 static expected create_error(Targs&&... args) noexcept;
223 explicit operator
bool() const noexcept;
227 bool has_error() const noexcept;
232 ErrorType& get_error() & noexcept;
237 const ErrorType& get_error() const& noexcept;
242 ErrorType&& get_error() && noexcept;
253 const expected& or_else(const cxx::
function_ref<
void(ErrorType&)>& callable) const noexcept;
264 expected& or_else(const cxx::
function_ref<
void(ErrorType&)>& callable) noexcept;
275 const expected& and_then(const cxx::
function_ref<
void()>& callable) const noexcept;
286 expected& and_then(const cxx::
function_ref<
void()>& callable) noexcept;
289 expected(
variant<ErrorType>&& store, const
bool hasError) noexcept;
292 static constexpr uint64_t ERROR_INDEX = 0U;
299class IOX_NO_DISCARD expected<ValueType, ErrorType>
320 expected& operator=(const expected&) noexcept;
324 expected& operator=(expected&& rhs) noexcept;
329 expected(const
success<ValueType>& successValue) noexcept;
334 expected(
success<ValueType>&& successValue) noexcept;
339 expected(const
error<ErrorType>& errorValue) noexcept;
344 expected(
error<ErrorType>&& errorValue) noexcept;
350 template <typename... Targs>
351 static expected create_value(Targs&&... args) noexcept;
357 template <typename... Targs>
358 static expected create_error(Targs&&... args) noexcept;
362 explicit operator
bool() const noexcept;
366 bool has_error() const noexcept;
371 ErrorType& get_error() & noexcept;
376 const ErrorType& get_error() const& noexcept;
381 ErrorType&& get_error() && noexcept;
386 ValueType& value() & noexcept;
391 const ValueType& value() const& noexcept;
396 ValueType&& value() && noexcept;
401 ValueType value_or(const ValueType& value) const noexcept;
406 ValueType value_or(const ValueType& value) noexcept;
418 ValueType& operator*() noexcept;
429 const ValueType& operator*() const noexcept;
438 ValueType* operator->() noexcept;
447 const ValueType* operator->() const noexcept;
460 template <typename T>
461 operator expected<T>() noexcept;
474 template <typename T>
475 operator expected<T>() const noexcept;
486 const expected& or_else(const cxx::
function_ref<
void(ErrorType&)>& callable) const noexcept;
497 expected& or_else(const cxx::
function_ref<
void(ErrorType&)>& callable) noexcept;
508 const expected& and_then(const cxx::
function_ref<
void(ValueType&)>& callable) const noexcept;
519 expected& and_then(const cxx::
function_ref<
void(ValueType&)>& callable) noexcept;
532 template <typename Optional = ValueType,
533 typename std::enable_if<internal::IsOptional<Optional>::value,
int>::type = 0>
534 const expected& and_then(const cxx::
function_ref<
void(typename Optional::type&)>& callable) const noexcept;
547 template <typename Optional = ValueType,
548 typename std::enable_if<internal::IsOptional<Optional>::value,
int>::type = 0>
549 expected& and_then(const cxx::
function_ref<
void(typename Optional::type&)>& callable) noexcept;
564 template <typename Optional = ValueType,
565 typename std::enable_if<internal::IsOptional<Optional>::value,
int>::type = 0>
566 [[deprecated]] const expected& if_empty(const cxx::
function_ref<
void()>& callable) const noexcept;
581 template <typename Optional = ValueType,
582 typename std::enable_if<internal::IsOptional<Optional>::value,
int>::type = 0>
583 [[deprecated]] expected& if_empty(const cxx::
function_ref<
void()>& callable) noexcept;
585 optional<ValueType> to_optional() const noexcept;
588 expected(
variant<ValueType, ErrorType>&& f_store, const
bool hasError) noexcept;
589 variant<ValueType, ErrorType> m_store;
591 static constexpr uint64_t VALUE_INDEX = 0U;
592 static constexpr uint64_t ERROR_INDEX = 1U;