|
Electroneum
|
#include <cassert>#include <system_error>#include <type_traits>#include <utility>#include "common/error.h"

Go to the source code of this file.
Classes | |
| struct | detail::expect |
| class | expect< T > |
| class | expect< void > |
Namespaces | |
| namespace | detail |
| declaration and default definition for the functions used the API | |
Macros | |
| #define | ELECTRONEUM_PRECOND(...) |
| If precondition fails, return ::error::kInvalidArgument in current scope. | |
| #define | ELECTRONEUM_CHECK(...) |
| Check expect<void> and return errors in current scope. | |
| #define | ELECTRONEUM_UNWRAP(...) |
| #define | ELECTRONEUM_THROW(code, msg) |
Typedefs | |
| template<bool C> | |
| using | detail::enable_if = typename std::enable_if<C>::type |
Functions | |
| *return An expect< void > object with | !has_error ()`. inline expect< void > success() noexcept |
| template<typename T, typename U> | |
| bool | operator== (expect< T > const &lhs, expect< U > const &rhs) noexcept(noexcept(lhs.equal(rhs))) |
| template<typename T, typename U> | |
| bool | operator== (expect< T > const &lhs, U const &rhs) noexcept(noexcept(lhs.equal(rhs))) |
| template<typename T, typename U> | |
| bool | operator== (T const &lhs, expect< U > const &rhs) noexcept(noexcept(rhs.equal(lhs))) |
| template<typename T, typename U> | |
| bool | operator!= (expect< T > const &lhs, expect< U > const &rhs) noexcept(noexcept(lhs.equal(rhs))) |
| template<typename T, typename U> | |
| bool | operator!= (expect< T > const &lhs, U const &rhs) noexcept(noexcept(lhs.equal(rhs))) |
| template<typename T, typename U> | |
| bool | operator!= (T const &lhs, expect< U > const &rhs) noexcept(noexcept(rhs.equal(lhs))) |
| #define ELECTRONEUM_CHECK | ( | ... | ) |
Check expect<void> and return errors in current scope.
Definition at line 47 of file expect.h.
| #define ELECTRONEUM_PRECOND | ( | ... | ) |
If precondition fails, return ::error::kInvalidArgument in current scope.
Definition at line 39 of file expect.h.
| #define ELECTRONEUM_THROW | ( | code, | |
| msg ) |
Definition at line 66 of file expect.h.
| #define ELECTRONEUM_UNWRAP | ( | ... | ) |
Get T from expect<T> by std::move as-if by function call. expect<void> returns nothing.
| std::system_error | with expect<T>::error(), filename and line number when expect<T>::has_error() == true. |
Definition at line 60 of file expect.h.
|
noexcept |
Definition at line 396 of file expect.h.
|
inlinenoexcept |
Definition at line 422 of file expect.h.