Updates referencesource to .NET 4.7
[mono.git] / mcs / class / referencesource / System.Core / System / Linq / Parallel / Utils / Pair.cs
1 // ==++==
2 //
3 //   Copyright (c) Microsoft Corporation.  All rights reserved.
4 // 
5 // ==--==
6 // =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
7 //
8 // Pair.cs
9 //
10 // <OWNER>Microsoft</OWNER>
11 //
12 // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
13
14 namespace System.Linq.Parallel
15 {
16     /// <summary>
17     /// A pair just wraps two bits of data into a single addressable unit. This is a
18     /// value type to ensure it remains very lightweight, since it is frequently used
19     /// with other primitive data types as well.
20     /// </summary>
21     /// <typeparam name="T"></typeparam>
22     /// <typeparam name="U"></typeparam>
23     internal struct Pair<T, U>
24     {
25
26         // The first and second bits of data.
27         internal T m_first;
28         internal U m_second;
29
30         //-----------------------------------------------------------------------------------
31         // A simple constructor that initializes the first/second fields.
32         //
33
34         public Pair(T first, U second)
35         {
36             m_first = first;
37             m_second = second;
38         }
39
40         //-----------------------------------------------------------------------------------
41         // Accessors for the left and right data.
42         //
43
44         public T First
45         {
46             get { return m_first; }
47             set { m_first = value; }
48         }
49
50         public U Second
51         {
52             get { return m_second; }
53             set { m_second = value; }
54         }
55
56     }
57 }