-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathTo.cs
More file actions
23 lines (22 loc) · 714 Bytes
/
To.cs
File metadata and controls
23 lines (22 loc) · 714 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* Date: 22.9.2017, Time: 11:46 */
using System;
using System.Runtime.CompilerServices;
namespace IllidanS4.SharpUtils
{
/// <summary>
/// Class used for fast (no-conversion) casts.
/// </summary>
public static class To<TTo>
{
/// <summary>
/// Shortcut to <see cref="Extensions.FastCast"/>. You can utilize generic type inference when calling this method.
/// </summary>
/// <param name="arg">The value, expressed as <typeparamref name="TFrom"/>.</param>
/// <returns>The same value, represented by <typeparamref name="TTo"/>.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static TTo Cast<TFrom>(TFrom arg)
{
return Extensions.FastCast<TFrom, TTo>(arg);
}
}
}