gpt4 book ai didi

c# - 是否有可能实现具有通用功能的索引运算符 '[]'

转载 作者:行者123 更新时间:2023-11-30 21:00:50 27 4
gpt4 key购买 nike

<分区>

Possible Duplicate:
Why it is not posible to define generic indexers in .NET?
how to write a function to take any object with an index operator

我从未见过这样的用法。但我只是想知道是否有可能实现像 bleow 这样的实现。我知道这是行不通的。但我的意思是如果存在类似的用法。

public T this<T>[T param]
{
get
{
....
}
}

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com