Daniele Bartolini 8 years ago
parent
commit
f23bf87889
1 changed files with 12 additions and 21 deletions
  1. 12 21
      src/core/pair.h

+ 12 - 21
src/core/pair.h

@@ -20,6 +20,9 @@ struct Pair<T1, T2, 0, 0>
 {
 {
 	ALLOCATOR_AWARE;
 	ALLOCATOR_AWARE;
 
 
+	T1 first;
+	T2 second;
+
 	Pair(T1& f, T2& s)
 	Pair(T1& f, T2& s)
 		: first(f)
 		: first(f)
 		, second(s)
 		, second(s)
@@ -29,9 +32,6 @@ struct Pair<T1, T2, 0, 0>
 	Pair(Allocator& /*a*/)
 	Pair(Allocator& /*a*/)
 	{
 	{
 	}
 	}
-
-	T1 first;
-	T2 second;
 };
 };
 
 
 template <typename T1, typename T2>
 template <typename T1, typename T2>
@@ -39,6 +39,9 @@ struct Pair<T1, T2, 1, 0>
 {
 {
 	ALLOCATOR_AWARE;
 	ALLOCATOR_AWARE;
 
 
+	T1 first;
+	T2 second;
+
 	Pair(T1& f, T2& s)
 	Pair(T1& f, T2& s)
 		: first(f)
 		: first(f)
 		, second(s)
 		, second(s)
@@ -49,9 +52,6 @@ struct Pair<T1, T2, 1, 0>
 		: first(a)
 		: first(a)
 	{
 	{
 	}
 	}
-
-	T1 first;
-	T2 second;
 };
 };
 
 
 template <typename T1, typename T2>
 template <typename T1, typename T2>
@@ -59,6 +59,9 @@ struct Pair<T1, T2, 0, 1>
 {
 {
 	ALLOCATOR_AWARE;
 	ALLOCATOR_AWARE;
 
 
+	T1 first;
+	T2 second;
+
 	Pair(T1& f, T2& s)
 	Pair(T1& f, T2& s)
 		: first(f)
 		: first(f)
 		, second(s)
 		, second(s)
@@ -69,9 +72,6 @@ struct Pair<T1, T2, 0, 1>
 		: second(a)
 		: second(a)
 	{
 	{
 	}
 	}
-
-	T1 first;
-	T2 second;
 };
 };
 
 
 template <typename T1, typename T2>
 template <typename T1, typename T2>
@@ -79,6 +79,9 @@ struct Pair<T1, T2, 1, 1>
 {
 {
 	ALLOCATOR_AWARE;
 	ALLOCATOR_AWARE;
 
 
+	T1 first;
+	T2 second;
+
 	Pair(T1& f, T2& s)
 	Pair(T1& f, T2& s)
 		: first(f)
 		: first(f)
 		, second(s)
 		, second(s)
@@ -90,22 +93,10 @@ struct Pair<T1, T2, 1, 1>
 		, second(a)
 		, second(a)
 	{
 	{
 	}
 	}
-
-	T1 first;
-	T2 second;
 };
 };
 
 
 #define PAIR(first, second) Pair<first, second, IS_ALLOCATOR_AWARE(first), IS_ALLOCATOR_AWARE(second)>
 #define PAIR(first, second) Pair<first, second, IS_ALLOCATOR_AWARE(first), IS_ALLOCATOR_AWARE(second)>
 
 
-template <typename T1, typename T2>
-PAIR(T1, T2) make_pair(Allocator& a, T1 first, T2 second)
-{
-	PAIR(T1, T2) pair(a);
-	pair.first = first;
-	pair.second = second;
-	return pair;
-}
-
 template <typename T1, typename T2>
 template <typename T1, typename T2>
 inline void swap(Pair<T1, T2, 0, 0>& a, Pair<T1, T2, 0, 0>& b)
 inline void swap(Pair<T1, T2, 0, 0>& a, Pair<T1, T2, 0, 0>& b)
 {
 {