mirror of https://github.com/dahall/Vanara.git
Made SafeMemoryHandle conversion to IntPtr implicit instead of explicit. In practice, I have found this to be a constant conversion need.
parent
2bf048944a
commit
0fef11ebb1
|
@ -176,10 +176,10 @@ namespace Vanara.InteropServices
|
||||||
/// <returns>The result of the conversion.</returns>
|
/// <returns>The result of the conversion.</returns>
|
||||||
public static unsafe explicit operator byte*(SafeAllocatedMemoryHandle hMem) => (byte*)hMem.handle;
|
public static unsafe explicit operator byte*(SafeAllocatedMemoryHandle hMem) => (byte*)hMem.handle;
|
||||||
|
|
||||||
/// <summary>Performs an explicit conversion from <see cref="SafeAllocatedMemoryHandle"/> to <see cref="System.IntPtr"/>.</summary>
|
/// <summary>Performs an implicit conversion from <see cref="SafeAllocatedMemoryHandle"/> to <see cref="System.IntPtr"/>.</summary>
|
||||||
/// <param name="hMem">The <see cref="SafeAllocatedMemoryHandle"/> instance.</param>
|
/// <param name="hMem">The <see cref="SafeAllocatedMemoryHandle"/> instance.</param>
|
||||||
/// <returns>The result of the conversion.</returns>
|
/// <returns>The result of the conversion.</returns>
|
||||||
public static explicit operator IntPtr(SafeAllocatedMemoryHandle hMem) => hMem.handle;
|
public static implicit operator IntPtr(SafeAllocatedMemoryHandle hMem) => hMem.handle;
|
||||||
|
|
||||||
private class SafeBufferImpl : SafeBuffer
|
private class SafeBufferImpl : SafeBuffer
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue