Added conversion operator to primitive types

このコミットが含まれているのは:
Sergio Pedri committed 2020-12-08 00:21:09 +01:00
1 親 04b6d35009
コミット 8cab3f98f2
12ファイル変更
+216

検索条件に一致するファイルはありません

+18
ファイルの表示
@@ -142,6 +142,24 @@ namespace ComputeSharp
/// <param name="x">The value to use for the components of the new <see cref="Int2"/> instance.</param>
public static implicit operator Int2(int x) => new(x, x);
/// <summary>
/// Casts a <see cref="Int2"/> value to a <see cref="UInt2"/> one.
/// </summary>
/// <param name="xy">The input <see cref="Int2"/> value to cast.</param>
public static explicit operator UInt2(Int2 xy) => throw new InvalidExecutionContextException($"{nameof(Int2)}.({nameof(UInt2)})");
/// <summary>
/// Casts a <see cref="Int2"/> value to a <see cref="Float2"/> one.
/// </summary>
/// <param name="xy">The input <see cref="Int2"/> value to cast.</param>
public static explicit operator Float2(Int2 xy) => throw new InvalidExecutionContextException($"{nameof(Int2)}.({nameof(Float2)})");
/// <summary>
/// Casts a <see cref="Int2"/> value to a <see cref="Double2"/> one.
/// </summary>
/// <param name="xy">The input <see cref="Int2"/> value to cast.</param>
public static explicit operator Double2(Int2 xy) => throw new InvalidExecutionContextException($"{nameof(Int2)}.({nameof(Double2)})");
/// <summary>
/// Sums two <see cref="Int2"/> values.
/// </summary>