Contract.ValueAtReturn<T>(T) Método

Definição

Representa o valor final (a saída) de um parâmetro out ao retornar de um método.Represents the final (output) value of an out parameter when returning from a method.

public:
generic <typename T>
 static T ValueAtReturn([Runtime::InteropServices::Out] T % value);
public static T ValueAtReturn<T> (out T value);
static member ValueAtReturn : 'T -> 'T
Public Shared Function ValueAtReturn(Of T) (ByRef value As T) As T

Parâmetros de tipo

T

O tipo do parâmetro out.The type of the out parameter.

Parâmetros

value
T

O parâmetro out.The out parameter.

Retornos

T

O valor de saída do parâmetro out.The output value of the out parameter.

Comentários

Esse método pode ser usado somente na expressão condicional para o Ensures contrato.This method can be used only in the conditional expression for the Ensures contract. Assim como ocorre com o método OldValue, é possível omitir o parâmetro de tipo genérico sempre que o compilador pode inferir seu tipo.As with the OldValue method, you can omit the generic type parameter whenever the compiler is able to infer its type. O reescritor de contrato substitui a chamada de método pelo valor do parâmetro out.The contract rewriter replaces the method call with the value of the out parameter. O método ValueAtReturn pode aparecer somente em pós-condições.The ValueAtReturn method may appear only in postconditions. O argumento para o método deve ser um parâmetro out ou um campo de um parâmetro out de estrutura.The argument to the method must be an out parameter or a field of a structure out parameter. Esse último também é útil ao se referir a campos na pós-condição de um construtor de estrutura.The latter is also useful when referring to fields in the postcondition of a structure constructor.

Aplica-se a