1 // Licensed to the .NET Foundation under one or more agreements.
2 // The .NET Foundation licenses this file to you under the MIT license.
3 // See the LICENSE file in the project root for more information.
5 using System
.Runtime
.CompilerServices
;
6 using System
.Runtime
.Versioning
;
10 // ByReference<T> is meant to be used to represent "ref T" fields. It is working
11 // around lack of first class support for byref fields in C# and IL. The JIT and
12 // type loader has special handling for it that turns it into a thin wrapper around ref T.
14 internal readonly ref struct ByReference
<T
>
16 // CS0169: The private field '{blah}' is never used
17 #pragma warning disable 169
18 #pragma warning disable CA1823
19 private readonly IntPtr _value
;
20 #pragma warning disable CA1823
21 #pragma warning restore 169
24 public ByReference(ref T
value)
26 // Implemented as a JIT intrinsic - This default implementation is for
27 // completeness and to provide a concrete error if called via reflection
28 // or if intrinsic is missed.
29 throw new PlatformNotSupportedException();
37 // Implemented as a JIT intrinsic - This default implementation is for
38 // completeness and to provide a concrete error if called via reflection
39 // or if the intrinsic is missed.
40 throw new PlatformNotSupportedException();