Claw  1.7.3
types.hpp
Go to the documentation of this file.
1 /*
2  CLAW - a C++ Library Absolutely Wonderful
3 
4  CLAW is a free library without any particular aim but being useful to
5  anyone.
6 
7  Copyright (C) 2005-2011 Julien Jorge
8 
9  This library is free software; you can redistribute it and/or
10  modify it under the terms of the GNU Lesser General Public
11  License as published by the Free Software Foundation; either
12  version 2.1 of the License, or (at your option) any later version.
13 
14  This library is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  Lesser General Public License for more details.
18 
19  You should have received a copy of the GNU Lesser General Public
20  License along with this library; if not, write to the Free Software
21  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 
23  contact: julien.jorge@gamned.org
24 */
31 #include <claw/meta/type_list.hpp>
33 
34 #ifndef __CLAW_TYPES_HPP__
35 #define __CLAW_TYPES_HPP__
36 
37 namespace claw
38 {
39 #ifdef CLAW_HAS_LONG_LONG
40 
41  typedef
42  meta::type_list<signed long long int, meta::no_type>
43  non_standard_signed_types;
44 
45  typedef
46  meta::type_list<unsigned long long int, meta::no_type>
47  non_standard_unsigned_types;
48 
49 #else // !def CLAW_HAS_LONG_LONG
50 
51  typedef meta::no_type non_standard_signed_types;
52  typedef meta::no_type non_standard_unsigned_types;
53 
54 #endif // CLAW_HAS_LONG_LONG
55 
57  typedef meta::type_list
58  < signed char,
59  meta::type_list
60  < signed short,
61  meta::type_list<signed int, non_standard_signed_types>
63 
65  typedef meta::type_list
66  < unsigned char,
68  < unsigned short,
71 
80  template<std::size_t Size, typename TypeList>
82  {
83  private:
84  typedef typename TypeList::head_type head_type;
85  typedef typename TypeList::queue_type queue_type;
86 
87  public:
90  typedef
91  typename meta::if_then_else
92  < sizeof(head_type) * 8 == Size, head_type,
94 
95  }; // find_type_by_size
96 
98  template<std::size_t Size>
99  struct find_type_by_size<Size, meta::no_type>
100  {
103  struct type;
104  }; // find_type_by_size
105 
112  template<std::size_t Size>
114  {
117 
118  }; // struct integer_of_size
119 
126  template<std::size_t Size>
128  {
131 
132  }; // struct unsigned_integer_of_size
133 
136 
139 
142 
145 
148 
151 
152 } // namespace claw
153 
154 #endif // __CLAW_TYPES_HPP__