Skip to content

Commit

Permalink
Add Delete(singular) overloads (ArrayParameterOverloader)
Browse files Browse the repository at this point in the history
  • Loading branch information
Perksey committed Apr 23, 2024
1 parent 710fa56 commit ea85042
Show file tree
Hide file tree
Showing 9 changed files with 4,565 additions and 8,083 deletions.
7 changes: 7 additions & 0 deletions sources/Core/Pointers/Ptr2D.cs
Original file line number Diff line number Diff line change
Expand Up @@ -397,5 +397,12 @@ public T[][] ToArray<T>(int length, int[] lengths)
MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization
)]
public override int GetHashCode() => base.GetHashCode();

/// <summary>
/// Creates a <see cref="Ptr2D"/> from a <see cref="Ptr"/> pointer.
/// </summary>
/// <param name="ptr">The pointer.</param>
/// <returns>The wrapped pointer.</returns>
public static implicit operator Ptr2D(Ptr* ptr) => (byte*)ptr;
}
}
7 changes: 7 additions & 0 deletions sources/Core/Pointers/Ptr2D.generic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -586,5 +586,12 @@ public T[][] ToArray(int length, int[] lengths) =>
MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization
)]
public override int GetHashCode() => base.GetHashCode();

/// <summary>
/// Creates a <see cref="Ptr2D{T}"/> from a <see cref="Ptr{T}"/> pointer.
/// </summary>
/// <param name="ptr">The pointer.</param>
/// <returns>The wrapped pointer.</returns>
public static implicit operator Ptr2D<T>(Ptr<T>* ptr) => (T**)ptr;
}
}
7 changes: 7 additions & 0 deletions sources/Core/Pointers/Ptr3D.cs
Original file line number Diff line number Diff line change
Expand Up @@ -429,5 +429,12 @@ ptr.Native is not null && ptr.Native->Native is not null
MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization
)]
public override int GetHashCode() => base.GetHashCode();

/// <summary>
/// Creates a <see cref="Ptr3D"/> from a <see cref="Ptr2D"/> pointer.
/// </summary>
/// <param name="ptr">The pointer.</param>
/// <returns>The wrapped pointer.</returns>
public static implicit operator Ptr3D(Ptr2D* ptr) => (byte***)ptr;
}
}
7 changes: 7 additions & 0 deletions sources/Core/Pointers/Ptr3D.generic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -612,5 +612,12 @@ ptr.Native is not null && ptr.Native->Native is not null
MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization
)]
public override int GetHashCode() => base.GetHashCode();

/// <summary>
/// Creates a <see cref="Ptr3D{T}"/> from a <see cref="Ptr2D{T}"/> pointer.
/// </summary>
/// <param name="ptr">The pointer.</param>
/// <returns>The wrapped pointer.</returns>
public static implicit operator Ptr3D<T>(Ptr2D<T>* ptr) => (T***)ptr;
}
}
Loading

0 comments on commit ea85042

Please sign in to comment.