This commit is contained in:
bbradson
2022-10-24 18:56:18 +02:00
parent 01ef055ff2
commit 9cdc8ccb4f
70 changed files with 19754 additions and 4 deletions
+19
View File
@@ -0,0 +1,19 @@
// Copyright (c) 2022 bradson
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
using System.Globalization;
using System.Runtime.CompilerServices;
namespace FisheryLib;
public static class Convert
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static unsafe TTo To<TFrom, TTo>(TFrom from) where TFrom : IConvertible
=> FunctionPointers.Convert<TFrom>.To<TTo>.Default(from, CultureInfo.InvariantCulture);
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static unsafe TTo To<TFrom, TTo>(TFrom from, IFormatProvider provider) where TFrom : IConvertible
=> FunctionPointers.Convert<TFrom>.To<TTo>.Default(from, provider);
}