Redigera

Dela via


Unsafe.BitCast<TFrom,TTo>(TFrom) Method

Definition

Reinterprets the given value of type TFrom as a value of type TTo.

public:
generic <typename TFrom, typename TTo>
 where TFrom : value class where TTo : value class static TTo BitCast(TFrom source);
public:
generic <typename TFrom, typename TTo>
 static TTo BitCast(TFrom source);
public static TTo BitCast<TFrom,TTo> (TFrom source) where TFrom : struct where TTo : struct;
public static TTo BitCast<TFrom,TTo> (TFrom source);
static member BitCast : 'From -> 'o (requires 'From : struct and 'o : struct)
static member BitCast : 'From -> 'o
Public Shared Function BitCast(Of TFrom As Structure, TTo As Structure) (source As TFrom) As TTo
Public Shared Function BitCast(Of TFrom, TTo) (source As TFrom) As TTo

Type Parameters

TFrom
TTo

Parameters

source
TFrom

Returns

TTo

A value of type TTo.

Exceptions

The size of TFrom and TTo are not the same.

Applies to