Add Boost.Test karmic valgrind suppressions
[senf.git] / boost / typeof / register_functions_iterate.hpp
1 // Copyright (C) 2004 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 #include <boost/typeof/encode_decode_params.hpp>
6
7 #define n BOOST_PP_ITERATION()
8
9 // function pointers
10
11 template<class V, class R BOOST_PP_ENUM_TRAILING_PARAMS(n, class P)> 
12 struct encode_type_impl<V, R(*)(BOOST_PP_ENUM_PARAMS(n, P))>
13 {
14     typedef R BOOST_PP_CAT(P, n);
15     typedef BOOST_TYPEOF_ENCODE_PARAMS(BOOST_PP_INC(n), FUN_PTR_ID + n) type;
16 };
17
18 template<class Iter>
19 struct decode_type_impl<boost::mpl::size_t<FUN_PTR_ID + n>, Iter>
20 {
21     typedef Iter iter0;
22     BOOST_TYPEOF_DECODE_PARAMS(BOOST_PP_INC(n))
23     typedef BOOST_PP_CAT(p, n)(*type)(BOOST_PP_ENUM_PARAMS(n, p));
24     typedef BOOST_PP_CAT(iter, BOOST_PP_INC(n)) iter;
25 };
26
27 #ifndef BOOST_TYPEOF_NO_FUNCTION_TYPES
28
29     // function references
30
31     template<class V, class R BOOST_PP_ENUM_TRAILING_PARAMS(n, class P)> 
32     struct encode_type_impl<V, R(&)(BOOST_PP_ENUM_PARAMS(n, P))>
33     {
34         typedef R BOOST_PP_CAT(P, n);
35         typedef BOOST_TYPEOF_ENCODE_PARAMS(BOOST_PP_INC(n), FUN_REF_ID + n) type;
36     };
37
38     template<class Iter>
39     struct decode_type_impl<boost::mpl::size_t<FUN_REF_ID + n>, Iter>
40     {
41         typedef Iter iter0;
42         BOOST_TYPEOF_DECODE_PARAMS(BOOST_PP_INC(n))
43         typedef BOOST_PP_CAT(p, n)(&type)(BOOST_PP_ENUM_PARAMS(n, p));
44         typedef BOOST_PP_CAT(iter, BOOST_PP_INC(n)) iter;
45     };
46
47     // functions
48
49     template<class V, class R BOOST_PP_ENUM_TRAILING_PARAMS(n, class P)> 
50     struct encode_type_impl<V, R(BOOST_PP_ENUM_PARAMS(n, P))>
51     {
52         typedef R BOOST_PP_CAT(P, n);
53         typedef BOOST_TYPEOF_ENCODE_PARAMS(BOOST_PP_INC(n), FUN_ID + n) type;
54     };
55
56     template<class Iter>
57     struct decode_type_impl<boost::mpl::size_t<FUN_ID + n>, Iter>
58     {
59         typedef Iter iter0;
60         BOOST_TYPEOF_DECODE_PARAMS(BOOST_PP_INC(n))
61         typedef BOOST_PP_CAT(p, n)(type)(BOOST_PP_ENUM_PARAMS(n, p));
62         typedef BOOST_PP_CAT(iter, BOOST_PP_INC(n)) iter;
63     };
64
65 #endif//BOOST_TYPEOF_NO_FUNCTION_TYPES
66
67 // member functions
68
69 #define BOOST_TYPEOF_qualifier 
70 #define BOOST_TYPEOF_id MEM_FUN_ID
71 #include <boost/typeof/register_mem_functions.hpp>
72
73 #define BOOST_TYPEOF_qualifier const
74 #define BOOST_TYPEOF_id CONST_MEM_FUN_ID
75 #include <boost/typeof/register_mem_functions.hpp>
76
77 #define BOOST_TYPEOF_qualifier volatile 
78 #define BOOST_TYPEOF_id VOLATILE_MEM_FUN_ID
79 #include <boost/typeof/register_mem_functions.hpp>
80
81 #define BOOST_TYPEOF_qualifier volatile const
82 #define BOOST_TYPEOF_id VOLATILE_CONST_MEM_FUN_ID
83 #include <boost/typeof/register_mem_functions.hpp>
84
85 #undef n