System::Threading::Tasks::ResultValueTask class

ResultValueTask class

Represents a hybrid task-like type that can wrap either a direct result value or a ResultTask.

template<typename T>class ResultValueTask : public System::IEquatable<ResultValueTask<T>>,
                                            public System::Details::BoxableObjectBase
ParameterDescription
TThe type of the result produced by the task.

Methods

MethodDescription
AsTask() constConverts this ResultValueTask to a shared pointer to ResultTask.
ConfigureAwait(bool) constConfigures an awaiter for this task.
Equals(ResultValueTask) overrideDetermines whether this instance equals another ResultValueTask instance.
Equals(System::SharedPtr<System::Object>) overrideDetermines whether this instance equals another object.
get_IsCanceled() constGets a value indicating whether the task completed due to being canceled.
get_IsCompleted() constGets a value indicating whether the task has completed.
get_IsCompletedSuccessfully() constGets a value indicating whether the task completed successfully.
get_IsFaulted() constGets a value indicating whether the task completed due to an unhandled exception.
get_Result() constGets the result of the completed task.
GetAwaiter() constGets an awaiter for this task to support await expressions.
operator!=(const ResultValueTask&) constInequality operator for ResultValueTask.
operator==(const ResultValueTask&) constEquality operator for ResultValueTask.
ResultValueTask()Constructs an empty, uninitialized ResultValueTask.
ResultValueTask(const T&)Constructs a completed ResultValueTask with the specified result.
ResultValueTask(const RTaskPtr<T>&)Constructs a ResultValueTask from a shared pointer to a ResultTask.

Remarks

ResultValueTask combines the benefits of ValueTask (reduced allocations for synchronous results) with the ability to wrap existing ResultTask objects. It provides awaitable interface and various task status inspection methods.

See Also