HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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 #include <SYS/SYS_Deprecated.h>
15 #include <utility>
16 
18 
19 template <class T1, class T2>
21 {
22 public:
23  SYS_DEPRECATED_REPLACE(18.5, "std::pair")
24  UT_Pair()
25  : myFirst(T1()), mySecond(T2()) { }
26  SYS_DEPRECATED_REPLACE(18.5, "std::pair")
27  UT_Pair(const T1 &v1, const T2 &v2)
28  : myFirst(v1), mySecond(v2) { }
29 
30  template <class U1 = T1, class U2 = T2>
31  SYS_DEPRECATED_REPLACE(18.5, "std::pair")
32  UT_Pair(U1 &&v1, U2 &&v2)
33  : myFirst(std::forward<U1>(v1))
34  , mySecond(std::forward<U2>(v2))
35  { }
36 
37  bool operator==(const UT_Pair<T1, T2> &p) const
38  {
39  return (myFirst == p.myFirst) && (mySecond == p.mySecond);
40  }
41  bool operator!=(const UT_Pair<T1, T2> &p) const
42  {
43  return (myFirst != p.myFirst) || (mySecond != p.mySecond);
44  }
45 
46  T1 myFirst;
48 };
49 
50 /// Common types
52 
53 template<typename OS, typename T1, typename T2>
54 inline OS &
55 operator<<(OS &os, const UT_Pair<T1, T2> &p)
56 {
57  os << "UT_Pair(" << p.myFirst << ", " << p.mySecond << ")";
58  return os;
59 }
60 
61 // For UT::ArraySet.
62 namespace UT
63 {
64  template <typename T>
65  struct DefaultClearer;
66 
67  template <typename S0, typename S1>
68  struct DefaultClearer<UT_Pair<S0, S1>>
69  {
71 
72  static void clear(Type &v)
73  {
76  }
77 
78  static bool isClear(const Type& v)
79  {
82  }
83 
84  static void clearConstruct(Type *p)
85  {
88  }
89 
90  static const bool clearNeedsDestruction =
93  };
94 }
95 
97 
98 #endif
*get result *(waiting if necessary)*A common idiom is to fire a bunch of sub tasks at the and then *wait for them to all complete We provide a helper class
Definition: thread.h:623
const GLdouble * v
Definition: glcorearb.h:837
#define SYS_DEPRECATED_PUSH_DISABLE()
static void clearConstruct(Type *p)
Definition: UT_Pair.h:84
#define SYS_DEPRECATED_POP_DISABLE()
T2 mySecond
Definition: UT_Pair.h:47
bool operator==(const UT_Pair< T1, T2 > &p) const
Definition: UT_Pair.h:37
bool operator!=(const UT_Pair< T1, T2 > &p) const
Definition: UT_Pair.h:41
GLfloat GLfloat GLfloat v2
Definition: glcorearb.h:818
#define SYS_DEPRECATED_REPLACE(__V__, __R__)
T1 myFirst
Definition: UT_Pair.h:46
UT_Pair< int, int > UT_IntPair
Common types.
Definition: UT_Pair.h:51
GLfloat GLfloat v1
Definition: glcorearb.h:817
#define const
Definition: zconf.h:214
static bool isClear(const Type &v)
Definition: UT_Pair.h:78