HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
UT_Pair.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: UT_Pair.h ( UT Library, C++)
7  *
8  * COMMENTS: Simple templated pair of variables.
9  */
10 
11 #ifndef __UT_Pair__
12 #define __UT_Pair__
13 
14 #ifdef WIN32
15  #pragma warning(disable:4251)
16  #pragma warning(disable:4275)
17 #endif
18 
19 template <class T1, class T2>
20 class UT_Pair {
21 public:
23  : myFirst(T1()), mySecond(T2()) { }
24  UT_Pair(T1 v1, T2 v2)
25  : myFirst(v1), mySecond(v2) { }
26 
27  bool operator==(const UT_Pair<T1, T2> &p) const
28  {
29  return (myFirst == p.myFirst) && (mySecond == p.mySecond);
30  }
31  bool operator!=(const UT_Pair<T1, T2> &p) const
32  {
33  return (myFirst != p.myFirst) || (mySecond != p.mySecond);
34  }
35 
36  T1 myFirst;
38 };
39 
40 /// Common types
42 
43 template<typename OS, typename T1, typename T2>
44 inline OS &
45 operator<<(OS &os, const UT_Pair<T1, T2> &p)
46 {
47  os << "UT_Pair(" << p.myFirst << ", " << p.mySecond << ")";
48  return os;
49 }
50 
51 #endif
T2 mySecond
Definition: UT_Pair.h:37
GLfloat GLfloat GLfloat v2
Definition: glcorearb.h:817
UT_Pair< int, int > UT_IntPair
Common types.
Definition: UT_Pair.h:41
bool operator!=(const UT_Pair< T1, T2 > &p) const
Definition: UT_Pair.h:31
UT_Pair(T1 v1, T2 v2)
Definition: UT_Pair.h:24
T1 myFirst
Definition: UT_Pair.h:36
UT_Pair()
Definition: UT_Pair.h:22
GLfloat GLfloat v1
Definition: glcorearb.h:816
bool operator==(const UT_Pair< T1, T2 > &p) const
Definition: UT_Pair.h:27