你不需要这么做
open System.Memory
open System
. 您可能还希望先将System.Memory添加到.NET framework应用程序中,然后引用它。我想知道FSI将如何与
Span<T>
.
#if INTERACTIVE
#r @"C:\Users\username\Documents\Source\ConsoleApplication1\packages\System.Memory.4.5.1\lib\netstandard2.0\System.Memory.dll"
#r "System.Runtime.dll"
#endif
open System
open System.Runtime.CompilerServices
[<IsByRefLike; Struct>]
type S(count1: Span<int>, count2: Span<int>) =
member x.Count1 = count1
member x.Count2 = count2