Commit patch to not break on spaces.
[bowtie.git] / SeqAn-1.1 / seqan / basic / basic_pointer.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_pointer.h,v 1.1 2008/08/25 16:20:01 langmead Exp $
19  ==========================================================================*/
20
21 #ifndef SEQAN_HEADER_BASIC_POINTER_H
22 #define SEQAN_HEADER_BASIC_POINTER_H
23
24 namespace SEQAN_NAMESPACE_MAIN
25 {
26
27 //////////////////////////////////////////////////////////////////////////////
28
29 //////////////////////////////////////////////////////////////////////////////
30
31 ///.Metafunction.Value.param.T.type:Adaption.char array
32
33 template <typename TValue>
34 struct Value< TValue * >
35 {
36         typedef TValue Type;
37 };
38 template <typename TValue>
39 struct Value< TValue * const>
40 {
41         typedef TValue Type;
42 };
43
44 //The next two metafunctions dont work in VC++ due to a compiler bug.
45 //(the default implementation in common_type.h is called instead)
46 //work-around: convert arrays to pointers.
47 template <typename TValue, size_t SIZE>
48 struct Value< TValue [SIZE] >
49 {
50         typedef TValue Type;
51 };
52 template <typename TValue, size_t SIZE>
53 struct Value< TValue const [SIZE] >
54 {
55         typedef TValue const Type;
56 };
57
58 //////////////////////////////////////////////////////////////////////////////
59
60 ///.Metafunction.Iterator.param.T.type:Adaption.char array
61
62 template <typename TValue>
63 struct Iterator< TValue *, Standard>
64 {
65         typedef TValue * Type;
66 };
67 template <typename TValue>
68 struct Iterator< TValue * const, Standard>
69 {
70         typedef TValue * Type;
71 };
72
73 //____________________________________________________________________________
74
75 template <typename TValue, size_t SIZE>
76 struct Iterator< TValue [SIZE], Standard>:
77         Iterator<TValue *, Standard>
78 {
79 };
80 template <typename TValue, size_t SIZE>
81 struct Iterator< TValue const [SIZE], Standard>:
82         Iterator<TValue const *, Standard>
83 {
84 };
85
86 template <typename TValue, size_t SIZE>
87 struct Iterator< TValue [SIZE], Rooted>:
88         Iterator<TValue *, Rooted>
89 {
90 };
91 template <typename TValue, size_t SIZE>
92 struct Iterator< TValue const [SIZE], Rooted>:
93         Iterator<TValue const *, Rooted>
94 {
95 };
96
97
98
99
100 //////////////////////////////////////////////////////////////////////////////
101 }// namespace SEQAN_NAMESPACE_MAIN
102
103 #endif //#ifndef SEQAN_HEADER_...