载入中...
搜索中...
未找到
Result.h 文件参考

Move-only, checked operation results for the common layer. 更多...

#include "common/Status.h"
#include <exception>
#include <functional>
#include <optional>
#include <string>
#include <string_view>
#include <type_traits>
#include <utility>
#include <vector>

浏览源代码.

类

class  eve::detail::ResultObservation
 Debug-only observation token shared by Result<T> specializations. 更多...
 
struct  eve::detail::ResultObservation::InactiveTag
 Start an inactive token used while a Result move is constructed. 更多...
 
class  eve::Result< T >
 Move-only operation result carrying either a value or Status. 更多...
 
class  eve::Result< void >
 Move-only operation result for actions with no value payload. 更多...
 

命名空间

namespace  eve
 Build metadata (engine git commit, build time, third-party version).
 
namespace  eve::detail
 

概念

concept  eve::detail::ResultConstConversion
 True when From may convert into To only by adding const.
 

宏定义

#define EV_DETAIL_RESULT_ASSERT(cond, message)    ::eve::detail::checkResultInvariant((cond), #cond, __FILE__, __LINE__, (message))
 

类型定义

template<class T >
using eve::detail::ResultReturn = std::invoke_result_t< T >
 

函数

void eve::detail::checkResultInvariant (bool condition, const char *expression, const char *file, unsigned line, const char *message)
 Check one Result invariant without instantiating the assertion backend in its caller.
 
void eve::detail::failResultExpectation (const Status &status, std::string_view message, const char *file, unsigned line, bool assertionsEnabled)
 Report a failed expect operation with its Status and caller context.
 
template<class T , class U >
void eve::detail::moveAssignOptional (std::optional< T > &destination, std::optional< U > &&source)
 Replace destination with source even when T is not assignable.
 
template<typename... Results>
bool eve::everyResultValid (const Results &... results) noexcept
 True only when every argument Result succeeded, observing all of them.
 

详细描述

Move-only, checked operation results for the common layer.

在文件 Result.h 中定义.

宏定义说明

◆ EV_DETAIL_RESULT_ASSERT

#define EV_DETAIL_RESULT_ASSERT (   cond,
  message 
)     ::eve::detail::checkResultInvariant((cond), #cond, __FILE__, __LINE__, (message))

在文件 Result.h 第 20 行定义.