FunVec1TUnderlyingScalar Field

The unified collection might be constructed with a constant scalar value; hence, returning the scalar for all indices. If this is the case, HasUnderlyingScalar is true; and the field UnderlyingScalar equals to Some of the underlying scalar value.

Otherwise, HasUnderlyingScalar is false and UnderlyingScalar.IsNone.

C#
// vec[i] = 10, for all i.
UniJaggedD1<int> vec = new(10);
Assert(vec[3] == 10 and vec[42] == 10);
Assert(vec.Get(12) == Some(10));

// underlying constant can be obtained by the optional UnderlyingScalar field.
Assert(vec.HasUnderlyingScalar);
Assert(vec.UnderlyingScalar.IsSome);
Assert(vec.UnderlyingScalar == Some(10));
Assert(vec.UnderlyingScalar.Unwrap() == 10);

Definition

Namespace: Orx.Fun.FunVec
Assembly: Orx.Fun.FunVec (in Orx.Fun.FunVec.dll) Version: 1.0.0
C#
public readonly Opt<T> UnderlyingScalar

Field Value

OptT

See Also