Table of Contents

Method PostDecExcept

Namespace
Zyl.VectorTraits.Impl.Util
Assembly
VectorTraits.dll

PostDecExcept<T>(ref T, out T, T, T)

When not equal to the specified value, post-decrement of the given managed pointer. It contains the checkValue parameter (当不与指定值相等时, 向给定的托管指针后置递减. 它含有 checkValue 参数). Mnemonic: beforeValue = (*p != checkValue) ? *p-- : newValue).

public static ref T PostDecExcept<T>(ref T source, out T beforeValue, T checkValue, T newValue) where T : IEquatable<T>

Parameters

source T

The managed pointer to decrement to (要向其递减的托管指针).

beforeValue T

When not equal to the specified value, returns the value pointed to before the decrement. Otherwise, it returns newValue (当不与指定值相等时, 返回递减前所指向的值. 否则便返回 newValue).

checkValue T

Special values to be check (将进行检查的特殊值).

newValue T

When equal to the specified value, beforeValue returns the new value (当与指定值相等时, beforeValue 会返回这个新值).

Returns

T

When not equal to the specified value, post-decrement of the given managed pointer. Otherwise, it returns source (当不与指定值相等时, 向给定的托管指针后置递减. 否则便返回 source).

Type Parameters

T

The elemental type of the managed pointer (托管指针的元素类型).

See Also
Subtract<T>(ref T, int)

PostDecExcept<T>(ref T, out T, T)

When not equal to the specified value, post-decrement of the given managed pointer (当不与指定值相等时, 向给定的托管指针后置递减). Mnemonic: beforeValue = (*p != checkValue) ? *p-- : newValue).

public static ref T PostDecExcept<T>(ref T source, out T beforeValue, T checkValue) where T : IEquatable<T>

Parameters

source T

The managed pointer to decrement to (要向其递减的托管指针).

beforeValue T

Returns the value pointed to before the decrement (返回递减前所指向的值).

checkValue T

Special values to be check (将进行检查的特殊值).

Returns

T

When not equal to the specified value, post-decrement of the given managed pointer. Otherwise, it returns source (当不与指定值相等时, 向给定的托管指针后置递减. 否则便返回 source).

Type Parameters

T

The elemental type of the managed pointer (托管指针的元素类型).

See Also
Subtract<T>(ref T, int)