Method PostIncExceptZero
- Namespace
- Zyl.VectorTraits.Impl.Util
- Assembly
- VectorTraits.dll
PostIncExceptZero<T>(ref T, out T, T)
When not equal to the zero, post-increment of the given managed pointer (当不与0相等时, 向给定的托管指针后置递增).
Mnemonic: beforeValue = (*p != 0) ? *p++ : newValue).
public static ref T PostIncExceptZero<T>(ref T source, out T beforeValue, T newValue = default) where T : struct, IEquatable<T>
Parameters
sourceTThe managed pointer to increment to (要向其递增的托管指针).
beforeValueTWhen not equal to the zero, returns the value pointed to before the increment. Otherwise, it returns
newValue(当不与0相等时, 返回递增前所指向的值. 否则便返回newValue).newValueTWhen equal to the zero,
beforeValuereturns the new value (当与0相等时,beforeValue会返回这个新值).
Returns
- T
When not equal to the zero, post-increment of the given managed pointer. Otherwise, it returns to the
source(当不与0相等时, 向给定的托管指针后置递增. 否则便返回source).
Type Parameters
TThe elemental type of the managed pointer (托管指针的元素类型).
- See Also