public static ValAndOff addOffset64(this ValAndOff x, long off) => func((_, panic, __) => { if (!x.canAdd(off)) { panic("invalid ValAndOff.add"); } return(ValAndOff(makeValAndOff(x.Val(), x.Off() + off))); });
public static bool canAdd32(this ValAndOff x, int off) { var newoff = x.Off() + int64(off); return(newoff == int64(int32(newoff))); }
public static @string String(this ValAndOff x) { return(fmt.Sprintf("val=%d,off=%d", x.Val(), x.Off())); }
public static bool canAdd(this ValAndOff x, long off) { var newoff = x.Off() + off; return(newoff == int64(int32(newoff))); }
public static int Off32(this ValAndOff x) { return(int32(x)); }
public static long Int64(this ValAndOff x) { return(int64(x)); }
public static long Off(this ValAndOff x) { return(int64(int32(x))); }
public static sbyte Val8(this ValAndOff x) { return(int8(int64(x) >> (int)(32L))); }
public static short Val16(this ValAndOff x) { return(int16(int64(x) >> (int)(32L))); }
public static int Val32(this ValAndOff x) { return(int32(int64(x) >> (int)(32L))); }
public static long Val(this ValAndOff x) { return(int64(x) >> (int)(32L)); }