The OpenD Programming Language

BigIntView.opCast

  1. T opCast()
  2. T opCast()
    struct BigIntView(W)
    @safe const scope
    T
    opCast
    (
    T
    bool nonZero = false
    )
    ()
    if (
    is(T == long) ||
    is(T == int)
    )
    if (
    is(Unqual!W == ubyte) ||
    is(Unqual!W == ushort)
    ||
    is(Unqual!W == uint)
    ||
    is(Unqual!W == ulong)
    )
  3. T opCast()
  4. BigIntView!V opCast()
  5. BigIntView!V opCast()

Examples

auto view = BigIntView!size_t.fromHexString("-afbbfae3cd0aff2714a1de7022b0021d");
assert(cast(long) view == -0x14a1de7022b0021d);
assert(cast(int) view == -0x22b0021d);
auto view = BigIntView!size_t.fromHexString!(char, true)("-afbb_fae3_cd0a_ff27_14a1_de70_22b0_021d");
assert(cast(long) view == -0x14a1de7022b0021d);
assert(cast(int) view == -0x22b0021d);

Meta