Subversion Repositories spk

Rev

Rev 1 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1 Rev 114
Line 6... Line 6...
6
 
6
 
7
template <class Ty1, class Ty2>
7
template <class Ty1, class Ty2>
8
class pair
8
class pair
9
{
9
{
10
	public:
10
	public:
-
 
11
		typedef Ty1 first_type;
-
 
12
		typedef Ty2 second_type;
-
 
13
		
11
		Ty1 left;
14
		Ty1 first;
12
		Ty2 right;
15
		Ty2 second;
13
 
16
		
-
 
17
		pair() 
-
 
18
			: first(Ty1()), second(Ty2()) { }
14
		pair(const Ty1 &val1, const Ty2 &;val2) { left=val1; right=val2; }
19
		pair(const Ty1& val1, const Ty2&; val2) 
15
		pair(const pair &other) { left=other.left; right=other.right; }
20
			: first(val1), second(val2) { }
16
		pair() { }
21
		pair(const pair& other)
-
 
22
			: first(other.first), second(other.second) { }
17
};
23
};
18
 
24
 
19
template <class Ty>
25
template <class Ty>
20
class less
26
class less
21
{
27
{
22
	public:
28
	public:
23
		bool operator() (const Ty& left, const Ty& right)
29
		bool operator() (const Ty& left, const Ty& right)
24
		{
30
		{
25
			return left < right;
31
			return first < second;
26
		}
32
		}
27
};
33
};
28
 
34
 
29
}; // namespace ext
35
}; // namespace ext
30
 
36