Commit patch to not break on spaces.
[bowtie.git] / SeqAn-1.1 / seqan / basic / basic_compare.h
1  /*==========================================================================
2                 SeqAn - The Library for Sequence Analysis
3                           http://www.seqan.de 
4  ============================================================================
5   Copyright (C) 2007
6
7   This library is free software; you can redistribute it and/or
8   modify it under the terms of the GNU Lesser General Public
9   License as published by the Free Software Foundation; either
10   version 3 of the License, or (at your option) any later version.
11
12   This library is distributed in the hope that it will be useful,
13   but WITHOUT ANY WARRANTY; without even the implied warranty of
14   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15   Lesser General Public License for more details.
16
17  ============================================================================
18   $Id: basic_compare.h,v 1.1 2008/08/25 16:20:01 langmead Exp $
19  ==========================================================================*/
20
21 #ifndef SEQAN_HEADER_BASIC_COMPARE_H
22 #define SEQAN_HEADER_BASIC_COMPARE_H
23
24 namespace SEQAN_NAMESPACE_MAIN
25 {
26
27 //////////////////////////////////////////////////////////////////////////////
28
29 template <typename TLeft, typename TRight>
30 struct CompareType;
31
32 template <typename TLeft, typename TRight>
33 struct CompareType<TLeft const, TRight>
34 {
35         typedef typename CompareType<TLeft, TRight>::Type const Type;
36 };
37 template <typename TLeft, typename TRight>
38 struct CompareType<TLeft, TRight const>
39 {
40         typedef typename CompareType<TLeft, TRight>::Type const Type;
41 };
42 template <typename TLeft, typename TRight>
43 struct CompareType<TLeft const, TRight const>
44 {
45         typedef typename CompareType<TLeft, TRight>::Type const Type;
46 };
47
48 //////////////////////////////////////////////////////////////////////////////
49
50 template<typename _T> inline
51 bool lexLess(const _T& _Left, const _T& _Right)
52 {       // return lexicographical _Left < _Right
53         typedef typename _MakeUnsigned<_T>::Type TUnsigned;
54     return (TUnsigned)_Left < (TUnsigned)_Right;
55 }
56
57 //////////////////////////////////////////////////////////////////////////////
58 }// namespace SEQAN_NAMESPACE_MAIN
59
60 #endif //#ifndef SEQAN_HEADER_...