Hos*_*Aly 36 c# generics syntax
如何在C#中执行以下操作?编写此代码段的第一行的正确方法是什么?
using KVP<K, V> = System.Collections.Generic.KeyValuePair<K, V>;
class C { KVP<int, string> x; }
Run Code Online (Sandbox Code Playgroud)
Mar*_*ell 39
基本上你不能.您只能使用固定别名,例如:
using Foo = System.Collections.Generic.KeyValuePair<int, string>;
class C { Foo x; }
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
3684 次 |
最近记录: |