TResult

A container that holds either a successful result or an erroneous result.

Choose your operating system:

Windows

macOS

Linux

Inheritance Hierarchy

References

Module

OnlineServicesInterface

Header

/Engine/Plugins/Online/Experimental/OnlineServices/Source/OnlineServicesInterface/Public/Online/OnlineResult.h

Include

#include "Online/OnlineResult.h"

Syntax

template<typename SuccessType, typename ErrorType>
class TResult

Remarks

A container that holds either a successful result or an erroneous result.

Constructors

Name Description

Protected function

TResult()

Public function

TResult

(
    const SuccessType& OkValue
)

Construct a result with an Ok value

Public function

TResult

(
    SuccessType&& OkValue
)

Construct a result with an Ok value

Public function

TResult

(
    const ErrorType& ErrValue
)

Construct a result with an error value

Public function

TResult

(
    ErrorType&& ErrValue
)

Construct a result with an error value

Public function

TResult

(
    const TResult& Other
)

Copy construct a result of the same type

Public function

TResult

(
    TResult&& Other
)

Move construct a result

Destructors

Name Description

Public function Virtual

~TResult()

Functions

Name Description

Public function Const

const ErrorT...

 

GetErrorValue()

Get the Error value stored in the result.

Public function

ErrorType &

 

GetErrorValue()

Get the Error value stored in the result.

Public function Const

const Succes...

 

GetOkOrDefault

(
    const SuccessType& DefaultValue
)

Unwraps the result, returning the success value if one is held, otherwise returning the default passed.

Public function Const

const Succes...

 

GetOkValue()

Get the Ok value stored in the result. This must not be called on a result holding the error type

Public function

SuccessType ...

 

GetOkValue()

Get the Ok value stored in the result. This must not be called on a result holding the error type

Public function Const

bool

 

IsError()

Check if the value held in the result is a ErrorType.

Public function Const

bool

 

IsOk()

Check if the value held in the result is a SuccessType.

Public function Const

const ErrorT...

 

TryGetErrorValue()

Convert from TResult to Error* if the result is erroneous.

Public function

ErrorType &#...

 

TryGetErrorValue()

Convert from TResult to Error* if the result is erroneous.

Public function Const

const Succes...

 

TryGetOkValue()

Convert from TResult to Success* if the result is successful.

Public function

SuccessType ...

 

TryGetOkValue()

Convert from TResult to Success* if the result is successful.

Operators

Name Description

Public function

TResult &

 

operator=

(
    const TResult& Other
)

Assign a result from another result

Public function

TResult &

 

operator=

(
    TResult&& Other
)

Move-assign a result