]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | // Copyright (C) 2005 Arkadiy Vertleyb |
2 | // Distributed under the Boost Software License, Version 1.0. (See accompanying | |
3 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | |
4 | ||
5 | #ifndef BOOST_TYPEOF_INTEGRAL_TEMPLATE_PARAM_HPP_INCLUDED | |
6 | #define BOOST_TYPEOF_INTEGRAL_TEMPLATE_PARAM_HPP_INCLUDED | |
7 | ||
8 | #define BOOST_TYPEOF_unsigned (unsigned) | |
9 | #define BOOST_TYPEOF_signed (signed) | |
10 | ||
11 | #define char_BOOST_TYPEOF (char) | |
12 | #define short_BOOST_TYPEOF (short) | |
13 | #define int_BOOST_TYPEOF (int) | |
14 | #define long_BOOST_TYPEOF (long) | |
15 | ||
16 | #define BOOST_TYPEOF_char_BOOST_TYPEOF (char) | |
17 | #define BOOST_TYPEOF_short_BOOST_TYPEOF (short) | |
18 | #define BOOST_TYPEOF_int_BOOST_TYPEOF (int) | |
19 | #define BOOST_TYPEOF_long_BOOST_TYPEOF (long) | |
20 | #define BOOST_TYPEOF_bool_BOOST_TYPEOF (bool) | |
21 | #define BOOST_TYPEOF_unsigned_BOOST_TYPEOF (unsigned) | |
22 | #define BOOST_TYPEOF_size_t_BOOST_TYPEOF (size_t) | |
23 | ||
24 | #define BOOST_TYPEOF_MAKE_OBJ_char BOOST_TYPEOF_INTEGRAL_PARAM(char) | |
25 | #define BOOST_TYPEOF_MAKE_OBJ_short BOOST_TYPEOF_INTEGRAL_PARAM(short) | |
26 | #define BOOST_TYPEOF_MAKE_OBJ_int BOOST_TYPEOF_INTEGRAL_PARAM(int) | |
27 | #define BOOST_TYPEOF_MAKE_OBJ_long BOOST_TYPEOF_INTEGRAL_PARAM(long) | |
28 | #define BOOST_TYPEOF_MAKE_OBJ_bool BOOST_TYPEOF_INTEGRAL_PARAM(bool) | |
29 | #define BOOST_TYPEOF_MAKE_OBJ_unsigned BOOST_TYPEOF_INTEGRAL_PARAM(unsigned) | |
30 | #define BOOST_TYPEOF_MAKE_OBJ_size_t BOOST_TYPEOF_INTEGRAL_PARAM(size_t) | |
31 | #define BOOST_TYPEOF_MAKE_OBJ_unsignedchar BOOST_TYPEOF_INTEGRAL_PARAM(unsigned char) | |
32 | #define BOOST_TYPEOF_MAKE_OBJ_unsignedshort BOOST_TYPEOF_INTEGRAL_PARAM(unsigned short) | |
33 | #define BOOST_TYPEOF_MAKE_OBJ_unsignedint BOOST_TYPEOF_INTEGRAL_PARAM(unsigned int) | |
34 | #define BOOST_TYPEOF_MAKE_OBJ_unsignedlong BOOST_TYPEOF_INTEGRAL_PARAM(unsigned long) | |
35 | #define BOOST_TYPEOF_MAKE_OBJ_signedchar BOOST_TYPEOF_INTEGRAL_PARAM(signed char) | |
36 | #define BOOST_TYPEOF_MAKE_OBJ_signedshort BOOST_TYPEOF_INTEGRAL_PARAM(signed short) | |
37 | #define BOOST_TYPEOF_MAKE_OBJ_signedint BOOST_TYPEOF_INTEGRAL_PARAM(signed int) | |
38 | #define BOOST_TYPEOF_MAKE_OBJ_signedlong BOOST_TYPEOF_INTEGRAL_PARAM(signed long) | |
39 | #define BOOST_TYPEOF_MAKE_OBJ_integral(x) BOOST_TYPEOF_INTEGRAL_PARAM(x) | |
40 | ||
41 | #define BOOST_TYPEOF_INTEGRAL(X) integral(X) BOOST_TYPEOF_EAT | |
42 | #define BOOST_TYPEOF_EAT_BOOST_TYPEOF | |
43 | #define BOOST_TYPEOF_integral(X) (integral(X)) | |
44 | ||
45 | #define BOOST_TYPEOF_INTEGRAL_PARAM(Type)\ | |
46 | (INTEGRAL_PARAM)\ | |
47 | (Type) | |
48 | ||
49 | #define BOOST_TYPEOF_INTEGRAL_PARAM_GETTYPE(Param)\ | |
50 | BOOST_PP_SEQ_ELEM(1, Param) | |
51 | ||
52 | #define BOOST_TYPEOF_INTEGRAL_PARAM_EXPANDTYPE(Param)\ | |
53 | BOOST_TYPEOF_INTEGRAL_PARAM_GETTYPE(Param) | |
54 | ||
55 | // INTEGRAL_PARAM "virtual functions" implementation | |
56 | ||
57 | #define BOOST_TYPEOF_INTEGRAL_PARAM_ENCODE(This, n)\ | |
58 | typedef typename boost::type_of::encode_integral<\ | |
59 | BOOST_PP_CAT(V, n),\ | |
60 | BOOST_TYPEOF_INTEGRAL_PARAM_GETTYPE(This),\ | |
61 | BOOST_PP_CAT(P, n)\ | |
62 | >::type BOOST_PP_CAT(V, BOOST_PP_INC(n)); | |
63 | ||
64 | #define BOOST_TYPEOF_INTEGRAL_PARAM_DECODE(This, n)\ | |
65 | typedef boost::type_of::decode_integral<BOOST_TYPEOF_INTEGRAL_PARAM_GETTYPE(This), BOOST_PP_CAT(iter, n)> BOOST_PP_CAT(d, n);\ | |
66 | static const BOOST_TYPEOF_INTEGRAL_PARAM_GETTYPE(This) BOOST_PP_CAT(P, n) = BOOST_PP_CAT(d, n)::value;\ | |
67 | typedef typename BOOST_PP_CAT(d, n)::iter BOOST_PP_CAT(iter, BOOST_PP_INC(n)); | |
68 | ||
69 | #define BOOST_TYPEOF_INTEGRAL_PARAM_PLACEHOLDER(Param)\ | |
70 | (BOOST_TYPEOF_INTEGRAL_PARAM_GETTYPE(Param))0 | |
71 | ||
72 | #define BOOST_TYPEOF_INTEGRAL_PARAM_DECLARATION_TYPE(Param)\ | |
73 | BOOST_TYPEOF_INTEGRAL_PARAM_GETTYPE(Param) | |
74 | ||
75 | #define BOOST_TYPEOF_INTEGRAL_PARAM_PLACEHOLDER_TYPES(Param, n)\ | |
76 | BOOST_PP_CAT(T,n) | |
77 | ||
78 | #define BOOST_TYPEOF_INTEGRAL_PARAM_ISTEMPLATE 0 | |
79 | ||
80 | #endif//BOOST_TYPEOF_INTEGRAL_TEMPLATE_PARAM_HPP_INCLUDED |