What's the best way of using a pair (triple, etc) of values as one value in C#?

前端 未结 16 2270
时光说笑
时光说笑 2021-02-07 03:00

That is, I\'d like to have a tuple of values.

The use case on my mind:

Dictionary, object>

or

<         


        
16条回答
  •  -上瘾入骨i
    2021-02-07 03:44

    public struct Pair
    {
        public T1 First;
        public T2 Second;
    }
    
    public struct Triple
    {
        public T1 First;
        public T2 Second;
        public T3 Third;
    }
    

提交回复
热议问题