/// <summary> /// Initializes a new instance of the <see cref="CodePointer{T}"/> class. /// </summary> /// <param name="variable">The variable.</param> public CodePointer(Variable variable) : base(variable) { if (!GetCodeType().IsPointer) { throw new Exception("Wrong code type of passed variable " + variable.GetCodeType().Name); } element = UserMember.Create(() => variable.DereferencePointer().CastAs <T>()); }
/// <summary> /// Initializes a new instance of the <see cref="CodePointer{T}"/> class. /// </summary> /// <param name="variable">The variable.</param> public CodePointer(Variable variable) : base(variable) { if (!GetCodeType().IsPointer) { throw new WrongCodeTypeException(variable, nameof(variable), "pointer"); } element = UserMember.Create(() => variable.DereferencePointer().CastAs <T>()); }