SwiftSelf<T> 结构
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
当参数为 Swift 冻结结构 T 时,表示 Swift“self”上下文,该结构要么注册到多个寄存器中,要么通过引用在“self”寄存器中传递。
generic <typename T>
where T : value classpublic value class SwiftSelf
public readonly struct SwiftSelf<T> where T : struct
type SwiftSelf<'T (requires 'T : struct)> = struct
Public Structure SwiftSelf(Of T)
类型参数
- T
要传入“self”上下文的冻结结构的类型。
- 继承
示例
下面是如何声明 SwiftSelf<T> 上下文的示例:
[UnmanagedCallConv(CallConvs = [typeof(CallConvSwift)])]
[LibraryImport("SwiftLibrary", EntryPoint = "export")]
public static extern void swiftFunction(SwiftSelf<T> self);
注解
此结构用于在与 .NET 互操作的上下文中将 Swift 冻结结构 T 传递给 Swift 函数。