Galois
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
CopyableTuple.h
Go to the documentation of this file.
1 /*
2  * This file belongs to the Galois project, a C++ library for exploiting
3  * parallelism. The code is being released under the terms of the 3-Clause BSD
4  * License (a copy is located in LICENSE.txt at the top-level directory).
5  *
6  * Copyright (C) 2018, The University of Texas at Austin. All rights reserved.
7  * UNIVERSITY EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES CONCERNING THIS
8  * SOFTWARE AND DOCUMENTATION, INCLUDING ANY WARRANTIES OF MERCHANTABILITY,
9  * FITNESS FOR ANY PARTICULAR PURPOSE, NON-INFRINGEMENT AND WARRANTIES OF
10  * PERFORMANCE, AND ANY WARRANTY THAT MIGHT OTHERWISE ARISE FROM COURSE OF
11  * DEALING OR USAGE OF TRADE. NO WARRANTY IS EITHER EXPRESS OR IMPLIED WITH
12  * RESPECT TO THE USE OF THE SOFTWARE OR DOCUMENTATION. Under no circumstances
13  * shall University be liable for incidental, special, indirect, direct or
14  * consequential damages or loss of profits, interruption of business, or
15  * related expenses which may arise from use of Software or Documentation,
16  * including but not limited to those resulting from defects in Software and/or
17  * Documentation, or loss or inaccuracy of data of any kind.
18  */
19 
25 #pragma once
26 
27 #include "galois/config.h"
28 
29 namespace galois {
30 
38 template <typename T1, typename T2>
39 struct Pair {
41  T1 first;
43  T2 second;
44 
46  Pair() {}
47 
49  Pair(T1 one, T2 two) {
50  first = one;
51  second = two;
52  }
53 };
54 
63 template <typename T1, typename T2, typename T3>
64 struct TupleOfThree {
66  T1 first;
68  T2 second;
70  T3 third;
71 
74 
76  TupleOfThree(T1 one, T2 two, T3 three) {
77  first = one;
78  second = two;
79  third = three;
80  }
81 };
82 
83 } // namespace galois
Pair()
empty constructor
Definition: CopyableTuple.h:46
Pair(T1 one, T2 two)
Constructor that initializes 2 fields.
Definition: CopyableTuple.h:49
T1 first
first element
Definition: CopyableTuple.h:66
TupleOfThree(T1 one, T2 two, T3 three)
Constructor that initializes 3 fields.
Definition: CopyableTuple.h:76
TupleOfThree()
empty constructor
Definition: CopyableTuple.h:73
T1 first
first element
Definition: CopyableTuple.h:41
Struct that contains 3 elements.
Definition: CopyableTuple.h:64
T2 second
second element
Definition: CopyableTuple.h:68
T2 second
second element
Definition: CopyableTuple.h:43
Struct that contains 2 elements.
Definition: CopyableTuple.h:39
T3 third
third element
Definition: CopyableTuple.h:70